Date ranges in Pandas Date ranges in Pandas pandas pandas

Date ranges in Pandas


freq='M' is for month-end frequencies (see here). But you can use .shift to shift it by any number of days (or any frequency for that matter):

pd.date_range(start, end, freq='M').shift(15, freq=pd.datetools.day)


There actually is no "day of month" frequency (e.g. "DOMXX" like "DOM09"), but I don't see any reason not to add one.

http://github.com/pydata/pandas/issues/2289

I don't have a simple workaround for you at the moment because resample requires passing a known frequency rule. I think it should be augmented to be able to take any date range to be used as arbitrary bin edges, also. Just a matter of time and hacking...


try

date_range(start, end, freq=pd.DateOffset(months=1))