Skip to content

ENH: add month_name to DatetimeIndex and .dt  #12805

Closed
@BastiaanBergman

Description

@BastiaanBergman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsDatetimeDatetime data dtypeEnhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions