![]() |
VOOZH | about |
Pandas dt.quarter attribute returns the quarter of the date in the underlying DateTime based data in the given Series object.
Output
👁 output of dt.quarter attributeSyntax: Series.dt.quarter
Parameter : None
Returns: NumPy array containing quarter value
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:
Use the dt.quarter attribute to return the quarter of the date in the underlying data of the given Series object.
Output :
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.