Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pandas resample question

Hi,

I want to get 15 minute interval data from history. I currently do this:

prices = history(60*390,"1m", "price").resample("15m")

My question is does this return the mean of every 15 minute interval or the last price of every 15 minute interval?

Could someone please help?

2 responses

Hi Pravin,

http://pandas.pydata.org/pandas-docs/stable/timeseries.html

default is mean

The how parameter can be a function name or numpy array function that takes an array and produces aggregated values

Any function available via dispatching can be given to the how parameter by name, including sum, mean, std, sem, max, min, median, first, last, ohlc.

Thanks Nicola.