Vous êtes un professionnel et vous avez besoin d'une formation ?
Sensibilisation àl'Intelligence Artificielle
Voir le programme détaillé
Module « pandas »
Classe « RangeIndex »
Informations générales
Héritage
builtins.object
DirNamesMixin
PandasObject
builtins.object
OpsMixin
IndexOpsMixin
Index
RangeIndex
Définition
class RangeIndex(Index):
help(RangeIndex)
Immutable Index implementing a monotonic integer range.
RangeIndex is a memory-saving special case of an Index limited to representing
monotonic ranges with a 64-bit dtype. Using RangeIndex may in some instances
improve computing speed.
This is the default index type used
by DataFrame and Series when no explicit index is provided by the user.
Parameters
----------
start : int (default: 0), range, or other RangeIndex instance
If int and "stop" is not given, interpreted as "stop" instead.
stop : int (default: 0)
step : int (default: 1)
dtype : np.int64
Unused, accepted for homogeneity with other index types.
copy : bool, default False
Unused, accepted for homogeneity with other index types.
name : object, optional
Name to be stored in the index.
Attributes
----------
start
stop
step
Methods
-------
from_range
See Also
--------
Index : The base pandas Index type.
Examples
--------
>>> list(pd.RangeIndex(5))
[0, 1, 2, 3, 4]
>>> list(pd.RangeIndex(-2, 4))
[-2, -1, 0, 1, 2, 3]
>>> list(pd.RangeIndex(0, 10, 2))
[0, 2, 4, 6, 8]
>>> list(pd.RangeIndex(2, -10, -3))
[2, -1, -4, -7]
>>> list(pd.RangeIndex(0))
[]
>>> list(pd.RangeIndex(1, 0))
[]
Constructeur(s)
Liste des attributs statiques
array | <pandas._libs.properties.CachedProperty object at 0x0000020D9B489680> |
hasnans | <pandas._libs.properties.CachedProperty object at 0x0000020D9B488B40> |
is_monotonic_decreasing | <pandas._libs.properties.CachedProperty object at 0x0000020D9B4B5EC0> |
is_monotonic_increasing | <pandas._libs.properties.CachedProperty object at 0x0000020D9B4B5E80> |
nbytes | <pandas._libs.properties.CachedProperty object at 0x0000020D9B4B5E40> |
Attributs statiques hérités de la classe Index
dtype, inferred_type, is_unique
Liste des propriétés
dtype | |
empty | |
has_duplicates | |
inferred_type | |
is_unique | return if the index has unique values [extrait de is_unique.__doc__] |
name | |
names | |
ndim | |
nlevels | |
shape | |
size | |
start | |
step | |
stop | |
T | |
values | |
Propriétés héritées de la classe Index
is_monotonic_decreasing, is_monotonic_increasing, nbytes
Propriétés héritées de la classe IndexOpsMixin
array
Opérateurs hérités de la classe Index
__iadd__, __invert__, __neg__, __pos__, __setitem__
Opérateurs hérités de la classe OpsMixin
__add__, __and__, __eq__, __ge__, __gt__, __le__, __lt__, __mod__, __mul__, __ne__, __or__, __pow__, __radd__, __rand__, __rfloordiv__, __rmod__, __rmul__, __ror__, __rpow__, __rsub__, __rtruediv__, __rxor__, __sub__, __truediv__, __xor__
Liste des méthodes
Toutes les méthodes
Méthodes d'instance
Méthodes statiques
Méthodes dépréciées
__iter__(self) -> 'Iterator[int]' |
|
__len__(self) -> 'int' |
|
__reduce__(self) |
|
all(self, *args, **kwargs) -> 'bool' |
|
any(self, *args, **kwargs) -> 'bool' |
|
argsort(self, *args, **kwargs) -> 'npt.NDArray[np.intp]' |
|
copy(self, name: 'Hashable | None' = None, deep: 'bool' = False) -> 'Self' |
|
delete(self, loc) -> 'Index' |
|
equals(self, other: 'object') -> 'bool' |
|
factorize(self, sort: 'bool' = False, use_na_sentinel: 'bool' = True) -> 'tuple[npt.NDArray[np.intp], RangeIndex]' |
|
from_range(data: 'range', name=None, dtype: 'Dtype | None' = None) -> 'Self' |
|
get_loc(self, key) -> 'int' |
|
insert(self, loc: 'int', item) -> 'Index' |
|
max(self, axis=None, skipna: 'bool' = True, *args, **kwargs) -> 'int' |
The maximum value of the RangeIndex [extrait de max.__doc__] |
memory_usage(self, deep: 'bool' = False) -> 'int' |
|
min(self, axis=None, skipna: 'bool' = True, *args, **kwargs) -> 'int' |
The minimum value of the RangeIndex [extrait de min.__doc__] |
sort_values(self, *, return_indexer: 'bool' = False, ascending: 'bool' = True, na_position: 'NaPosition' = 'last', key: 'Callable | None' = None) -> 'Self | tuple[Self, np.ndarray | RangeIndex]' |
|
symmetric_difference(self, other, result_name: 'Hashable | None' = None, sort=None) |
|
take(self, indices, axis: 'Axis' = 0, allow_fill: 'bool' = True, fill_value=None, **kwargs) -> 'Index' |
|
tolist(self) -> 'list[int]' |
|
Méthodes héritées de la classe Index
__abs__, __array__, __array_ufunc__, __array_wrap__, __bool__, __copy__, __deepcopy__, __init_subclass__, __nonzero__, __repr__, __subclasshook__, append, argmax, argmin, asof, asof_locs, astype, diff, difference, drop, drop_duplicates, droplevel, dropna, duplicated, fillna, format, get_indexer, get_indexer_for, get_indexer_non_unique, get_level_values, get_slice_bound, groupby, holds_integer, identical, infer_objects, intersection, is_, is_boolean, is_categorical, is_floating, is_integer, is_interval, is_numeric, is_object, isin, isna, isnull, join, map, notna, notnull, putmask, ravel, reindex, rename, repeat, round, set_names, shift, slice_indexer, slice_locs, sort, sortlevel, to_flat_index, to_frame, to_series, union, unique, view, where
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
item, nunique, searchsorted, 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__,
__getstate__,
__hash__,
__reduce_ex__,
__setattr__,
__str__
Vous êtes un professionnel et vous avez besoin d'une formation ?
Sensibilisation àl'Intelligence Artificielle
Voir le programme détaillé
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 :