Skip to content

Commit 8f8b136

Browse files
update readme
1 parent 2c191d0 commit 8f8b136

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# traces
2-
31
<!-- [![Version](https://img.shields.io/pypi/v/traces.svg?)](https://pypi.python.org/pypi/traces) -->
42
<!-- [![PyVersions](https://img.shields.io/pypi/pyversions/traces.svg)](https://pypi.python.org/pypi/traces) -->
53
<!-- [![Documentation Status](https://readthedocs.org/projects/traces/badge/?version=master)](https://traces.readthedocs.io/en/master/?badge=master) -->
@@ -9,6 +7,8 @@
97
[![codecov](https://codecov.io/gh/stringertheory/traces/branch/main/graph/badge.svg)](https://codecov.io/gh/stringertheory/traces)
108
[![Commit activity](https://img.shields.io/github/commit-activity/y/stringertheory/traces)](https://img.shields.io/github/commit-activity/m/stringertheory/traces)
119

10+
# traces
11+
1212
A Python library for unevenly-spaced time series analysis.
1313

1414
## Why?
@@ -29,7 +29,7 @@ analysis](https://traces.readthedocs.io/).
2929

3030
To install traces, run this command in your terminal:
3131

32-
```bash
32+
```shell
3333
$ pip install traces
3434
```
3535

@@ -44,7 +44,7 @@ The main object in traces is a [TimeSeries](https://traces.readthedocs.io/en/mas
4444
create just like a dictionary, adding the five measurements at 6:00am,
4545
7:45:56am, etc.
4646

47-
```python
47+
```pycon
4848
>>> time_series = traces.TimeSeries()
4949
>>> time_series[datetime(2042, 2, 1, 6, 0, 0)] = 0 # 6:00:00am
5050
>>> time_series[datetime(2042, 2, 1, 7, 45, 56)] = 1 # 7:45:56am
@@ -57,15 +57,15 @@ What if you want to know if the light was on at 11am? Unlike a python
5757
dictionary, you can look up the value at any time even if it's not one
5858
of the measurement times.
5959

60-
```python
60+
```pycon
6161
>>> time_series[datetime(2042, 2, 1, 11, 0, 0)] # 11:00am
6262
0
6363
```
6464

6565
The `distribution` function gives you the fraction of time that the
6666
`TimeSeries` is in each state.
6767

68-
```python
68+
```pycon
6969
>>> time_series.distribution(
7070
>>> start=datetime(2042, 2, 1, 6, 0, 0), # 6:00am
7171
>>> end=datetime(2042, 2, 1, 13, 0, 0) # 1:00pm
@@ -86,7 +86,7 @@ How many lights are on throughout the day? The merge function takes the
8686
forty individual `TimeSeries` and efficiently merges them into one
8787
`TimeSeries` where the each value is a list of all lights.
8888

89-
```python
89+
```pycon
9090
>>> trace_list = [... list of forty traces.TimeSeries ...]
9191
>>> count = traces.TimeSeries.merge(trace_list, operation=sum)
9292
```
@@ -99,7 +99,7 @@ We also applied a `sum` operation to the list of states to get the
9999
How many lights are on in the building on average during business hours,
100100
from 8am to 6pm?
101101

102-
```python
102+
```pycon
103103
>>> histogram = count.distribution(
104104
>>> start=datetime(2042, 2, 1, 8, 0, 0), # 8:00am
105105
>>> end=datetime(2042, 2, 1, 12 + 6, 0, 0) # 6:00pm
@@ -119,18 +119,18 @@ long as they can be ordered. The values can be anything.
119119
For example, you can use a `TimeSeries` to keep track the contents of a
120120
grocery basket by the number of minutes within a shopping trip.
121121

122-
```python
122+
```pycon
123123
>>> time_series = traces.TimeSeries()
124124
>>> time_series[1.2] = {'broccoli'}
125125
>>> time_series[1.7] = {'broccoli', 'apple'}
126126
>>> time_series[2.2] = {'apple'} # puts broccoli back
127127
>>> time_series[3.5] = {'apple', 'beets'} # mmm, beets
128128
```
129129

130-
To learn more, check the [examples](https://traces.readthedocs.io/en/master/examples.html) and the detailed [reference](https://traces.readthedocs.io/en/master/api_reference.html#).
131-
132130
## More info
133131

132+
To learn more, check the [examples](https://traces.readthedocs.io/en/master/examples.html) and the detailed [reference](https://traces.readthedocs.io/en/master/api_reference.html#).
133+
134134
## Contributing
135135

136136
Contributions are welcome and greatly appreciated! Please visit our [guidelines](https://github.com/datascopeanalytics/traces/blob/master/CONTRIBUTING.md)

0 commit comments

Comments
 (0)