pandas resample documentation pandas resample documentation python python

pandas resample documentation


B         business day frequencyC         custom business day frequency (experimental)D         calendar day frequencyW         weekly frequencyM         month end frequencySM        semi-month end frequency (15th and end of month)BM        business month end frequencyCBM       custom business month end frequencyMS        month start frequencySMS       semi-month start frequency (1st and 15th)BMS       business month start frequencyCBMS      custom business month start frequencyQ         quarter end frequencyBQ        business quarter endfrequencyQS        quarter start frequencyBQS       business quarter start frequencyA         year end frequencyBA, BY    business year end frequencyAS, YS    year start frequencyBAS, BYS  business year start frequencyBH        business hour frequencyH         hourly frequencyT, min    minutely frequencyS         secondly frequencyL, ms     millisecondsU, us     microsecondsN         nanoseconds

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 to how by name.


There's more to it than this, but you're probably looking for this list:

B   business day frequencyC   custom business day frequency (experimental)D   calendar day frequencyW   weekly frequencyM   month end frequencyBM  business month end frequencyMS  month start frequencyBMS business month start frequencyQ   quarter end frequencyBQ  business quarter endfrequencyQS  quarter start frequencyBQS business quarter start frequencyA   year end frequencyBA  business year end frequencyAS  year start frequencyBAS business year start frequencyH   hourly frequencyT   minutely frequencyS   secondly frequencyL   millisecondsU   microseconds

Source: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases