1In [101]: df.resample('1H').agg({'openbid': 'first',
2 'highbid': 'max',
3 'lowbid': 'min',
4 'closebid': 'last'})
5Out[101]:
6 lowbid highbid closebid openbid
7ctime
82015-09-30 23:00:00 1.11687 1.11712 1.11708 1.117
9
1#We can also use custom functions and apply them when resampling using the .apply(method_name) method
2#This is an example used in a downsampling example
3def custom_resampler(arraylike):
4 return np.sum(arraylike) + 5
5data.resample('Q').apply(custom_resampler)