So I completely understand how to use resample, but the documentation does not do a good job explaining the options.
So most options in the resample
function are pretty straight forward except for these two:
- rule : the offset string or object representing target conversion
- how : string, method for down- or re-sampling, default to ‘mean’
So from looking at as many examples as I found online I can see for rule you can do 'D'
for day, 'xMin'
for minutes, 'xL'
for milliseconds, but that is all I could find.
for how I have seen the following: 'first'
, np.max
, 'last'
, 'mean'
, and 'n1n2n3n4...nx'
where nx is the first letter of each column index.
So is there somewhere in the documentation that I am missing that displays every option for pandas.resample
's rule and how inputs? If yes, where because I could not find it. If no, what are all the options for them?
See the timeseries documentation. It includes a list of offsets (and 'anchored' offsets), and a section about resampling.
Note that there isn't a list of all the different
how
options, because it can be any NumPy array function and any function that is available via groupby dispatching can be passed tohow
by name.There's more to it than this, but you're probably looking for this list:
Source: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases