The end_time property of a PeriodIndex object in pandas returns the ending timestamp of each period in the PeriodIndex.
A Period in pandas represents a time span, for example, a specific day or month. When you have a series of such periods, they can be organized into a PeriodIndex. The end_time property will then give you the ending point of each of those periods.
Here's an example to demonstrate the use of the end_time property:
import pandas as pd # Create a PeriodIndex pi = pd.PeriodIndex(start='2021-01', end='2021-04', freq='M') # Display the PeriodIndex print("PeriodIndex:") print(pi) # Get the end times of each period in the PeriodIndex print("\nEnd times:") print(pi.end_time) Output:
PeriodIndex: PeriodIndex(['2021-01', '2021-02', '2021-03', '2021-04'], dtype='period[M]', freq='M') End times: DatetimeIndex(['2021-01-31', '2021-02-28', '2021-03-31', '2021-04-30'], dtype='datetime64[ns]', freq=None)
In the example:
PeriodIndex starting from January 2021 to April 2021 with a monthly frequency (freq='M').end_time property then provides the ending timestamp for each of those months.function-pointers java.util.date extract wildcard collectors iso8601 adminer linear-gradients limit double-click