Command line script and Python library to manipulate time series.
pip install tstoolbox==100.3.3
The tstoolbox is a Python script to manipulate time-series on the command line or by function calls within Python. Uses pandas (http://pandas.pydata.org/) or numpy (http://numpy.scipy.org) for any heavy lifting.
Should be as easy as running pip install tstoolbox
or easy_install
tstoolbox
at any command line. Not sure on Windows whether this will bring
in pandas, but as mentioned above, if you start with scientific Python
distribution then you shouldn't have a problem.
Just run 'tstoolbox --help' to get a list of subcommands
{fill,about,createts,filter,read,date_slice,describe,peak_detection,convert,equation,pick,stdtozrxp,tstopickle,accumulate,rolling_window,aggregate,replace,clip,add_trend,remove_trend,calculate_fdc,stack,unstack,plot,dtw,pca,normalization,converttz,convert_index_to_julian,pct_change,rank,date_offset} ...
The default for all of the subcommands is to accept data from stdin (typically a pipe). If a subcommand accepts an input file for an argument, you can use "--input_ts=input_file_name.csv", or to explicitly specify from stdin (the default) "--input_ts='-'".
For the subcommands that output data it is printed to the screen and you can then redirect to a file.
You can use all of the command line subcommands as functions. The function signature is identical to the command line subcommands. The return is always a PANDAS DataFrame. Input can be a CSV or TAB separated file, or a PANDAS DataFrame and is supplied to the function via the 'input_ts' keyword.
Simply import tstoolbox:
from tstoolbox import tstoolbox # Then you could call the functions ntsd = tstoolbox.fill(method='linear', input_ts='tests/test_fill_01.csv') # Once you have a PANDAS DataFrame you can use that as input to other # tstoolbox functions. ntsd = tstoolbox.aggregate(statistic='mean', agg_interval='daily', input_ts=ntsd)