Module « pandas »
Classe « PeriodIndex »
Informations générales
Héritage
builtins.object
DirNamesMixin
PandasObject
builtins.object
OpsMixin
IndexOpsMixin
Index
ExtensionIndex
NDArrayBackedExtensionIndex
DatetimeIndexOpsMixin
PeriodIndex
Définition
class PeriodIndex(DatetimeIndexOpsMixin):
Description [extrait de PeriodIndex.__doc__]
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
month : int, array, or Series, default None
quarter : int, array, or Series, default None
day : int, array, or Series, default None
hour : int, array, or Series, default None
minute : int, array, or Series, default None
second : int, array, or Series, default None
tz : object, default None
Timezone for converting datetime64 data to Periods.
dtype : str or PeriodDtype, default None
Attributes
----------
day
dayofweek
day_of_week
dayofyear
day_of_year
days_in_month
daysinmonth
end_time
freq
freqstr
hour
is_leap_year
minute
month
quarter
qyear
second
start_time
week
weekday
weekofyear
year
Methods
-------
asfreq
strftime
to_timestamp
See Also
--------
Index : The base pandas Index type.
Period : Represents a period of time.
DatetimeIndex : Index with datetime64 data.
TimedeltaIndex : Index of timedelta64 data.
period_range : Create a fixed-frequency PeriodIndex.
Examples
--------
>>> idx = pd.PeriodIndex(year=[2000, 2002], quarter=[1, 3])
>>> idx
PeriodIndex(['2000Q1', '2002Q3'], dtype='period[Q-DEC]', freq='Q-DEC')
Constructeur(s)
Liste des attributs statiques
array | <pandas._libs.properties.CachedProperty object at 0x7f504b9fe2c0> |
dtype | <pandas._libs.properties.CachedProperty object at 0x7f504bd2af00> |
hasnans | <pandas._libs.properties.CachedProperty object at 0x7f504b755080> |
inferred_freq | <pandas._libs.properties.CachedProperty object at 0x7f504b751d00> |
is_all_dates | <pandas._libs.properties.CachedProperty object at 0x7f504bd34c40> |
is_unique | <pandas._libs.properties.CachedProperty object at 0x7f504bd34880> |
resolution | <pandas._libs.properties.CachedProperty object at 0x7f504b7554c0> |
Attributs statiques hérités de la classe DatetimeIndexOpsMixin
inferred_type
Liste des propriétés
asi8 | |
day | |
day_of_week | |
day_of_year | |
dayofweek | |
dayofyear | |
days_in_month | |
daysinmonth | |
empty | |
end_time | |
freq | |
freqstr | |
has_duplicates | |
hour | |
inferred_type | |
is_full | |
is_leap_year | |
is_monotonic | |
is_monotonic_decreasing | |
is_monotonic_increasing | |
minute | |
month | |
name | |
names | |
nbytes | |
ndim | |
nlevels | |
quarter | |
qyear | |
second | |
shape | |
size | |
start_time | |
T | |
values | |
week | |
weekday | |
weekofyear | |
year | |
Propriétés héritées de la classe IndexOpsMixin
array, dtype, is_unique
Opérateurs hérités de la classe ExtensionIndex
__getitem__
Opérateurs hérités de la classe Index
__and__, __iadd__, __inv__, __neg__, __or__, __pos__, __setitem__, __xor__
Opérateurs hérités de la classe OpsMixin
__add__, __eq__, __floordiv__, __ge__, __gt__, __le__, __lt__, __mod__, __mul__, __ne__, __pow__, __radd__, __rand__, __rfloordiv__, __rmod__, __rmul__, __ror__, __rpow__, __rsub__, __rtruediv__, __rxor__, __sub__, __truediv__
Liste des méthodes
Toutes les méthodes
Méthodes d'instance
Méthodes statiques
Méthodes dépréciées
__array_wrap__(self, result, context=None) |
|
asfreq(self, freq=None, how: str = 'E') -> 'PeriodIndex' |
|
asof_locs(self, where: pandas.core.indexes.base.Index, mask: numpy.ndarray) -> numpy.ndarray |
|
astype(self, dtype, copy: bool = True, how=<object object at 0x7f5051439e10>) |
|
difference(self, other, sort=None) |
|
get_indexer(self, target, method=None, limit=None, tolerance=None) |
|
get_loc(self, key, method=None, tolerance=None) |
|
insert(self, loc: int, item) |
|
intersection(self, other, sort=False) |
|
join(self, other, how='left', level=None, return_indexers=False, sort=False) |
|
memory_usage(self, deep: bool = False) -> int |
|
to_timestamp(self, freq=None, how='start') -> pandas.core.indexes.datetimes.DatetimeIndex |
|
Méthodes héritées de la classe DatetimeIndexOpsMixin
__init_subclass__, __subclasshook__, argmax, argmin, delete, equals, format, max, min, shift, take, tolist
Méthodes héritées de la classe NDArrayBackedExtensionIndex
putmask, where
Méthodes héritées de la classe ExtensionIndex
map, repeat, searchsorted
Méthodes héritées de la classe Index
__abs__, __array__, __bool__, __copy__, __deepcopy__, __hash__, __len__, __nonzero__, __reduce__, __repr__, all, any, append, argsort, asof, copy, drop, drop_duplicates, droplevel, dropna, duplicated, fillna, get_indexer_for, get_indexer_non_unique, get_level_values, get_slice_bound, get_value, groupby, holds_integer, identical, is_, is_boolean, is_categorical, is_floating, is_integer, is_interval, is_mixed, is_numeric, is_object, is_type_compatible, isin, isna, isnull, notna, notnull, ravel, reindex, rename, set_names, set_value, slice_indexer, slice_locs, sort, sort_values, sortlevel, symmetric_difference, to_flat_index, to_frame, to_native_types, to_series, union, unique, view
Méthodes héritées de la classe PandasObject
__sizeof__
Méthodes héritées de la classe DirNamesMixin
__dir__
Méthodes héritées de la classe IndexOpsMixin
__iter__, factorize, item, nunique, to_list, to_numpy, transpose, value_counts
Méthodes héritées de la classe OpsMixin
__divmod__, __rdivmod__
Méthodes héritées de la classe object
__delattr__,
__format__,
__getattribute__,
__reduce_ex__,
__setattr__,
__str__
Améliorations / Corrections
Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Emplacement :
Description des améliorations :