![]() |
VOOZH | about |
Pandas dt.month_name() method returns the month names of the DateTimeIndex with specified locale.
Output
👁 dt.month_name() method output
Syntax: Series.dt.month_name(locale=None)
Parameter
- locale : Locale determining the language in which to return the month name. Default is English locale.
Returns: Index of month names
To get the names of the months from the DateTime objects in a Pandas Series we use the dt.month_name() method of the Pandas library in Python.
Let us understand it better with an example:
Use the Series.dt.month_name() function to return the month names of the underlying DateTime data in the given series object. Return the names of the month in French language.
Output :
Now we will use the Series.dt.month_name() function to return the names of the month of each timestamp in the given series object.
Output :
As we can see in the output, the Series.dt.month_name() function has successfully returned the names of the month in the specified language.