Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Sample input data and python code for Pandas time-series problem

View pandas-example.py
1 2 3 4 5 6 7 8 9 10 11
import pandas as pd
 
data_frame = pd.io.parsers.read_csv('time-series.csv',index_col = 0, names=['index','heave'])
_max = [[5, 259.0]]
indexes = [x[0] for x in _max ]
index = data_frame.index
timestamps = [index[z] for z in indexes]
#['2011-12-30 00:00:04']
print data_frame.ix[timestamps]
# heave
#2011-12-30 00:00:04 259
View pandas-example.py
1 2 3 4 5 6 7 8 9 10 11
2011-12-30 00:00:00,-310.0
2011-12-30 00:00:01,-238.0
2011-12-30 00:00:01.500000,-114.0
2011-12-30 00:00:02.500000,60.0
2011-12-30 00:00:03,185.0
2011-12-30 00:00:04,259.0
2011-12-30 00:00:04.500000,231.0
2011-12-30 00:00:05.500000,139.0
2011-12-30 00:00:06.500000,55.0
2011-12-30 00:00:07,-49.0
2011-12-30 00:00:08,-144.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.