consider the DatetimeIndex tidx
tidx = pd.to_datetime([\'2016-07-29\', \'2016-08-31\', \'2016-09-30\'])
print(tidx.freq)
print(tidx
It's unclear why the docs state you can set the freq attribute but then it doesn't persist but if you reconstruct the datetimeindex again but pass a freq param then it works:
In [56]:
tidx = pd.DatetimeIndex(tidx.values, freq = tidx.inferred_freq)
tidx
Out[56]:
DatetimeIndex(['2016-07-29', '2016-08-31', '2016-09-30'], dtype='datetime64[ns]', freq='BM')