class pandas.PeriodIndex
[source]
Immutable ndarray holding ordinal values indicating regular periods in time such as particular years, quarters, months, etc.
Index keys are boxed to Period objects which carries the metadata (eg, frequency information).
Parameters: |
|
---|
See also
Index
Period
DatetimeIndex
TimedeltaIndex
period_range
Creating a PeriodIndex based on start
, periods
, and end
has been deprecated in favor of period_range()
.
>>> idx = pd.PeriodIndex(year=year_arr, quarter=q_arr)
day | The days of the period |
dayofweek | The day of the week with Monday=0, Sunday=6 |
dayofyear | The ordinal day of the year |
days_in_month | The number of days in the month |
daysinmonth | The number of days in the month |
freq | Return the frequency object if it is set, otherwise None. |
freqstr | Return the frequency object as a string if it is set, otherwise None. |
hour | The hour of the period |
is_leap_year | Logical indicating if the date belongs to a leap year |
minute | The minute of the period |
month | The month as January=1, December=12 |
quarter | The quarter of the date |
second | The second of the period |
week | The week ordinal of the year |
weekday | The day of the week with Monday=0, Sunday=6 |
weekofyear | The week ordinal of the year |
year | The year of the period |
end_time | |
qyear | |
start_time |
asfreq (self, \*args, \*\*kwargs) | Convert the Period Array/Index to the specified frequency freq . |
strftime (self, \*args, \*\*kwargs) | Convert to Index using specified date_format. |
to_timestamp (self, \*args, \*\*kwargs) | Cast to DatetimeArray/Index. |
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.PeriodIndex.html