Skip to main content

A toolbox to analyse diagnostic train data!

Project description

PyPI - Python Version Pypi package PyPI - License Code style: black Launch Binder

A Python library for unevenly-spaced time series analysis in train diagnostics. Build on top of the magnificent ticts library.

Installation

pip install traindiagnostics

Want to try it out first without installing? With binder you can test out the code in an online jupyter notebook.

Usage

 import traindiagnostics as td
 ts = td.TimeSeries({
     '2019-01-01 09:00:00': 0,
     '2019-01-01 09:00:05': 1,
     '2019-01-01 09:01:02': 0,
     '2019-01-01 09:05:09': 1,
     '2019-01-01 09:05:16': 0,
     '2019-01-01 09:11:01': 1,
     '2019-01-01 09:12:59': 0,
 })

not_in_index = '2019-01-01 00:05:00'
assert ts[not_in_index] == 1  # step function, previous value

ts['2019-01-01 00:04:00'] = 10
assert ts[not_in_index] == 10

assert ts + ts == 2 * ts

ts_evenly_spaced = ts.sample(freq='1Min')

# From ticts to pandas, and the other way around
assert ts.equals(
   ts.to_dataframe().to_ticts(),
)

Contributing

Missing some features? create an issue or pull request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for traindiagnostics, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size traindiagnostics-0.3.0-py2.py3-none-any.whl (19.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size traindiagnostics-0.3.0.tar.gz (18.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page