VOOZH about

URL: https://www.geeksforgeeks.org/pandas/pandas-series-dt-month/

⇱ Pandas Series dt.month | Extract Month Part From DateTime Series - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pandas Series dt.month | Extract Month Part From DateTime Series

Last Updated : 11 Jul, 2025

The dt.month attribute returns a NumPy array containing the month of the DateTime in the underlying data of the given Series object.

Example

Output:

👁 month value of datetime

Syntax

Syntax: Series.dt.month 

Parameter : None 

Returns: NumPy array with month values of DateTime object

How to Extract Month Value From DateTime Object in Pandas Series

To extract the month value from the DateTime object we use the Series.dt.month attribute of the Pandas library in Python

Let us understand it better with an example:

Example:

Use the Series.dt.month attribute of Pandas library to return the month of the DateTime in the underlying data of the given Series object.

Output :

👁 time series created

Now we will use the Series.dt.month attribute to return the month of the DateTime in the underlying data of the given Series object.

Output :

👁 month values of datetime

As we can see in the output, the Series.dt.month attribute has successfully accessed and returned the month of the DateTime in the underlying data of the given series object.

Comment

Explore