PeriodIndex.quarter
Pandas PeriodIndex.quarter
returns an Index object containing a quarter of the date for each period in the given PeriodIndex object.
Syntax: PeriodIndex.quarter
Parameters: None
Return: Index object
Example # 1: Use the PeriodIndex.quarter
attribute to get the quarter date for each period in this PeriodIndex object.
|
Output:
Now we will use the PeriodIndex.quarter
attribute to get the quarter date for each period in pidx .
|
Output:
As we can see in the output, the PeriodIndex.quarter
attribute returned an Index object containing the quarter value for this PeriodIndex object.
Example # 2: Use the attribute PeriodIndex.quarter
to get the quarter date for each period in a given PeriodIndex object.
|
Output:
Now we will use the PeriodIndex.quarter
attribute to find out the quarter dates for each period in pidx.
|
Output:
As we can see in the output, the PeriodIndex.quarter
attribute returned an Index object containing the quarter value for this PeriodIndex object.