On this page
pandas.Series.dt.month_name
- Series.dt.month_name(*args, **kwargs)[source]
-
Return the month names with specified locale.
- Parameters
-
- locale:str, optional
-
Locale determining the language in which to return the month name. Default is English locale.
- Returns
-
- Series or Index
-
Series or Index of month names.
Examples
>>> s = pd.Series(pd.date_range(start='2018-01', freq='M', periods=3)) >>> s 0 2018-01-31 1 2018-02-28 2 2018-03-31 dtype: datetime64[ns] >>> s.dt.month_name() 0 January 1 February 2 March dtype: object
>>> idx = pd.date_range(start='2018-01', freq='M', periods=3) >>> idx DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31'], dtype='datetime64[ns]', freq='M') >>> idx.month_name() Index(['January', 'February', 'March'], dtype='object')
© 2008–2022, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.5.0/reference/api/pandas.Series.dt.month_name.html