After fighting with NumPy and dateutil for days, I recently discovered the amazing Pandas library. I\'ve been poring through the documentation and source code, but I can\'t
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...
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)
try
date_range(start, end, freq=pd.DateOffset(months=1))