Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Pandas Frequency documentation

Tags:

python

pandas

I have been trying to get a proper documentation for the freq arguments associated with pandas. For example to resample a dataframe we can do something like

df.resample(rule='W', how='sum')

which will resample this weekly. I was wondering what are the other options and how can I define custom frequency/rules.

EDIT : To clarify I am looking at what are the other legal options for rule

like image 212
goofd Avatar asked Feb 20 '14 04:02

goofd


1 Answers

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

And, almost immediately below that: W-SAT and others.

I'll admit, links to this particular piece of documentation are pretty scarce. More general frequencies can be represented by supplying a DateOffset instance. Even more general resamplings can be done via groupby.

like image 132
U2EF1 Avatar answered Oct 21 '22 01:10

U2EF1