VOOZH about

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

⇱ Pandas Series dt.quarter | Find Quarter from DateTime Object - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pandas Series dt.quarter | Find Quarter from DateTime Object

Last Updated : 11 Jul, 2025

Pandas dt.quarter attribute returns the quarter of the date in the underlying DateTime based data in the given Series object.

Example

Output

👁 output of dt.quarter attribute

Syntax

Syntax: Series.dt.quarter 

Parameter : None 

Returns: NumPy array containing quarter value

How to Get Quarter Value from DateTime Object in Pandas Series

To get the quarter value from the DateTime object in the Pandas series we use the dt.quarter attribute of the Pandas library in Python.

Let us understand it better with an example:

Example:

Use the dt.quarter attribute to return the quarter of the date in the underlying data of the given Series object.

Output :

👁 datetime series created

Now we will use the Series.dt.quarter attribute to return the quarter of the date in the DateTime based data in the given series object.

Output :

👁 printing quarter from datetime object

As we can see in the output, the Pandas dt.quarter attribute has successfully accessed and returned the quarter of the date in the underlying data of the given series object.

Comment

Explore