ENH: add month_name to DatetimeIndex and .dt · Issue #12805 · pandas-dev/pandas (original) (raw)
Add a month name property to DatetimeIndex and the .dt accessor; similar to weekday_name (GH12803).
Code Sample:
i = pd.date_range('20150112 08:34:23', periods = 4, freq = '1D')
i.month_name
d = pd.Timestamp("2016-04-04")
d.month_name
s = pd.Series(i, range(4))
s.dt.month_name
Expected Output:
array(['January', 'January', 'January', 'January'], dtype=object)
'April'
0 January
1 January
2 January
3 January
dtype: object