Participer au site avec un Tip
Rechercher
 

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 :

Module « pandas »

Classe « IntervalIndex »

Informations générales

Héritage

builtins.object
    DirNamesMixin
        PandasObject
builtins.object
    OpsMixin
        IndexOpsMixin
            Index
                ExtensionIndex
            builtins.object
                IntervalMixin
                    IntervalIndex

Définition

class IntervalIndex(IntervalMixin, ExtensionIndex):

Description [extrait de IntervalIndex.__doc__]

Immutable index of intervals that are closed on the same side.

.. versionadded:: 0.20.0

Parameters
----------
data : array-like (1-dimensional)
    Array-like containing Interval objects from which to build the
    IntervalIndex.
closed : {'left', 'right', 'both', 'neither'}, default 'right'
    Whether the intervals are closed on the left-side, right-side, both or
    neither.
dtype : dtype or None, default None
    If None, dtype will be inferred.
copy : bool, default False
    Copy the input data.
name : object, optional
     Name to be stored in the index.
verify_integrity : bool, default True
    Verify that the IntervalIndex is valid.

Attributes
----------
left
right
closed
mid
length
is_empty
is_non_overlapping_monotonic
is_overlapping
values

Methods
-------
from_arrays
from_tuples
from_breaks
contains
overlaps
set_closed
to_tuples

See Also
--------
Index : The base pandas Index type.
Interval : A bounded slice-like interval; the elements of an IntervalIndex.
interval_range : Function to create a fixed frequency IntervalIndex.
cut : Bin values into discrete Intervals.
qcut : Bin values into equal-sized Intervals based on rank or sample quantiles.

Notes
-----
See the `user guide
<https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#intervalindex>`_
for more.

Examples
--------
A new ``IntervalIndex`` is typically constructed using
:func:`interval_range`:

>>> pd.interval_range(start=0, end=5)
IntervalIndex([(0, 1], (1, 2], (2, 3], (3, 4], (4, 5]],
              closed='right',
              dtype='interval[int64]')

It may also be constructed using one of the constructor
methods: :meth:`IntervalIndex.from_arrays`,
:meth:`IntervalIndex.from_breaks`, and :meth:`IntervalIndex.from_tuples`.

See further examples in the doc strings of ``interval_range`` and the
mentioned constructor methods.

Constructeur(s)

Signature du constructeur Description
__new__(cls, data, closed=None, dtype=None, copy: bool = False, name=None, verify_integrity: bool = True)

Liste des attributs statiques

Nom de l'attribut Valeur
array<pandas._libs.properties.CachedProperty object at 0x7f504b9fe2c0>
closed<pandas._libs.properties.CachedProperty object at 0x7f504b721f80>
dtype<pandas._libs.properties.CachedProperty object at 0x7f504bd2af00>
hasnans<pandas._libs.properties.CachedProperty object at 0x7f504bd34d40>
is_all_dates<pandas._libs.properties.CachedProperty object at 0x7f504bd34c40>
is_monotonic_decreasing<pandas._libs.properties.CachedProperty object at 0x7f504b721340>
is_non_overlapping_monotonic<pandas._libs.properties.CachedProperty object at 0x7f504b721f40>
is_unique<pandas._libs.properties.CachedProperty object at 0x7f504b721380>
left<pandas._libs.properties.CachedProperty object at 0x7f504b721900>
mid<pandas._libs.properties.CachedProperty object at 0x7f504b721a40>
right<pandas._libs.properties.CachedProperty object at 0x7f504b7219c0>
values<pandas._libs.properties.CachedProperty object at 0x7f504b721240>

Attributs statiques hérités de la classe ExtensionIndex

inferred_type

Attributs statiques hérités de la classe IntervalMixin

closed_left, closed_right, is_empty, length, open_left, open_right

Liste des propriétés

Nom de la propriétéDescription
asi8
empty
has_duplicates
inferred_typeReturn a string of the type inferred from the values [extrait de __doc__]
is_monotonic
is_monotonic_increasing
is_overlapping
length
name
names
nbytes
ndim
nlevels
shape
size
T

Propriétés héritées de la classe ExtensionIndex

is_monotonic_decreasing, values

Propriétés héritées de la classe IndexOpsMixin

array, dtype, is_unique

Liste des opérateurs

Signature de l'opérateur Description
__contains__(self, key: Any) -> bool

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
Signature de la méthodeDescription
__array_wrap__(self, result, context=None)
__reduce__(self)
astype(self, dtype, copy: bool = True)
delete(self, loc)
difference(self, other, sort=None)
from_arrays(left, right, closed: str = 'right', name=None, copy: bool = False, dtype=None)
from_breaks(breaks, closed: str = 'right', name=None, copy: bool = False, dtype=None)
from_tuples(data, closed: str = 'right', name=None, copy: bool = False, dtype=None)
get_indexer(self, target: ~AnyArrayLike, method: Optional[str] = None, limit: Optional[int] = None, tolerance: Optional[Any] = None) -> numpy.ndarray
get_indexer_non_unique(self, target: ~AnyArrayLike) -> Tuple[numpy.ndarray, numpy.ndarray]
get_loc(self, key, method: Optional[str] = None, tolerance=None) -> Union[int, slice, numpy.ndarray]
insert(self, loc, item)
intersection(self, other, sort=False) -> pandas.core.indexes.base.Index
memory_usage(self, deep: bool = False) -> int
putmask(self, mask, value)
symmetric_difference(self, other, sort=None)
where(self, cond, other=None)

Méthodes héritées de la classe ExtensionIndex

__init_subclass__, __subclasshook__, equals, map, repeat, searchsorted

Méthodes héritées de la classe Index

__abs__, __array__, __bool__, __copy__, __deepcopy__, __hash__, __len__, __nonzero__, __repr__, all, any, append, argsort, asof, asof_locs, copy, drop, drop_duplicates, droplevel, dropna, duplicated, fillna, format, get_indexer_for, 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, join, notna, notnull, ravel, reindex, rename, set_names, set_value, shift, slice_indexer, slice_locs, sort, sort_values, sortlevel, take, 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__, argmax, argmin, factorize, item, max, min, nunique, to_list, to_numpy, tolist, transpose, value_counts

Méthodes héritées de la classe OpsMixin

__divmod__, __rdivmod__

Méthodes héritées de la classe IntervalMixin

__setstate__

Méthodes héritées de la classe object

__delattr__, __format__, __getattribute__, __reduce_ex__, __setattr__, __str__