MCPcopy
hub / github.com/pandas-dev/pandas / PeriodIndex

Class PeriodIndex

pandas/core/indexes/period.py:89–546  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

87@inherit_names(["is_leap_year"], PeriodArray)
88@set_module("pandas")
89class PeriodIndex(DatetimeIndexOpsMixin):
90 """
91 Immutable ndarray holding ordinal values indicating regular periods in time.
92
93 Index keys are boxed to Period objects which carries the metadata (eg,
94 frequency information).
95
96 Parameters
97 ----------
98 data : array-like (1d int np.ndarray or PeriodArray), optional
99 Optional period-like data to construct index with.
100 freq : str or period object, optional
101 One of pandas period strings or corresponding objects.
102 dtype : str or PeriodDtype, default None
103 A dtype from which to extract a freq.
104 copy : bool, default None
105 Whether to copy input data, only relevant for array, Series, and Index
106 inputs (for other input, e.g. a list, a new array is created anyway).
107 Defaults to True for array input and False for Index/Series.
108 Set to False to avoid copying array input at your own risk (if you
109 know the input data won't be modified elsewhere).
110 Set to True to force copying Series/Index input up front.
111 name : str, default None
112 Name of the resulting PeriodIndex.
113
114 Attributes
115 ----------
116 day
117 dayofweek
118 day_of_week
119 dayofyear
120 day_of_year
121 days_in_month
122 daysinmonth
123 end_time
124 freq
125 freqstr
126 hour
127 is_leap_year
128 minute
129 month
130 quarter
131 qyear
132 second
133 start_time
134 week
135 weekday
136 weekofyear
137 year
138
139 Methods
140 -------
141 asfreq
142 strftime
143 to_timestamp
144 from_fields
145 from_ordinals
146

Callers 15

time_from_date_rangeMethod · 0.90
time_from_pydatetimeMethod · 0.90
time_from_intsMethod · 0.90
time_from_ints_dailyMethod · 0.90
setupMethod · 0.90
_convert_1dMethod · 0.90
_get_time_period_binsMethod · 0.90
_get_period_binsMethod · 0.90
test_factorize_periodMethod · 0.90
TestPeriodArrayClass · 0.90
test_strftime_natMethod · 0.90

Calls

no outgoing calls