riodIndex.from_ordinals ](pandas.PeriodIndex.from_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Index objects ](../indexing.html)
  * pandas.PeriodIndex 

#  pandas.PeriodIndex  #

_ class  _ pandas.  PeriodIndex  (  _ data  =  None  _ , _ ordinal  =  None  _
, _ freq  =  None  _ , _ dtype  =  None  _ , _ copy  =  False  _ , _ name  =
None  _ , _ **  fields  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/period.py#L80-L544) #

    

Immutable ndarray holding ordinal values indicating regular periods in time.

Index keys are boxed to Period objects which carries the metadata (eg,
frequency information).

Parameters  :

    

**data** array-like (1d int np.ndarray or PeriodArray), optional

    

Optional period-like data to construct index with.

**copy** bool

    

Make a copy of input ndarray.

**freq** str or period object, optional

    

One of pandas period strings or corresponding objects.

**year** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**month** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**quarter** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**day** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**hour** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**minute** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**second** int, array, or Series, default None

    

Deprecated since version 2.2.0:  Use PeriodIndex.from_fields instead.

**dtype** str or PeriodDtype, default None

    

See also

[ ` Index  ` ](pandas.Index.html#pandas.Index "pandas.Index")

    

The base pandas Index type.

[ ` Period  ` ](pandas.Period.html#pandas.Period "pandas.Period")

    

Represents a period of time.

[ ` DatetimeIndex  ` ](pandas.DatetimeIndex.html#pandas.DatetimeIndex
"pandas.DatetimeIndex")

    

Index with datetime64 data.

[ ` TimedeltaIndex  ` ](pandas.TimedeltaIndex.html#pandas.TimedeltaIndex
"pandas.TimedeltaIndex")

    

Index of timedelta64 data.

[ ` period_range  ` ](pandas.period_range.html#pandas.period_range
"pandas.period_range")

    

Create a fixed-frequency PeriodIndex.

Examples

    
    
    >>> idx = pd.PeriodIndex.from_fields(year=[2000, 2002], quarter=[1, 3])
    >>> idx
    PeriodIndex(['2000Q1', '2002Q3'], dtype='period[Q-DEC]')
    

Attributes

[ ` day  ` ](pandas.PeriodIndex.day.html#pandas.PeriodIndex.day "pandas.PeriodIndex.day") |  The days of the period.   
---|---  
[ ` dayofweek  ` ](pandas.PeriodIndex.dayofweek.html#pandas.PeriodIndex.dayofweek "pandas.PeriodIndex.dayofweek") |  The day of the week with Monday=0, Sunday=6.   
[ ` day_of_week  ` ](pandas.PeriodIndex.day_of_week.html#pandas.PeriodIndex.day_of_week "pandas.PeriodIndex.day_of_week") |  The day of the week with Monday=0, Sunday=6.   
[ ` dayofyear  ` ](pandas.PeriodIndex.dayofyear.html#pandas.PeriodIndex.dayofyear "pandas.PeriodIndex.dayofyear") |  The ordinal day of the year.   
[ ` day_of_year  ` ](pandas.PeriodIndex.day_of_year.html#pandas.PeriodIndex.day_of_year "pandas.PeriodIndex.day_of_year") |  The ordinal day of the year.   
[ ` days_in_month  ` ](pandas.PeriodIndex.days_in_month.html#pandas.PeriodIndex.days_in_month "pandas.PeriodIndex.days_in_month") |  The n