without the loffset open-high-low-close (ohlcresampling in financean ubiquitous way to aggregate time series is to compute four values for each bucketthe first (open)last (close)maximum (high)and minimal (lowvalues by passing how='ohlcyou will obtain dataframe having columns containing these four aggregateswhich are efficiently computed in single sweep of the datain [ ]ts resample(' min'how='ohlc'out[ ]open high low close : : : : : : : : resampling with groupby an alternate way to downsample is to use pandas' groupby functionality for exampleyou can group by month or weekday by passing function that accesses those fields on the time series' indexin [ ]rng pd date_range(''periods= freq=' 'in [ ]ts series(np arange( )index=rngin [ ]ts groupby(lambda xx monthmean(out[ ] in [ ]ts groupby(lambda xx weekdaymean(out[ ] upsampling and interpolation when converting from low frequency to higher frequencyno aggregation is needed let' consider dataframe with some weekly datain [ ]frame dataframe(np random randn( )index=pd date_range(''periods= freq=' -wed')columns=['colorado''texas''new york''ohio'] time series www it-ebooks info