Index objects#

Index#

Many of these methods or variants thereof are available on the objects that contain an index (Series/DataFrame) and those should most likely be used before calling these methods directly.

Index(*args, **kwargs)

Immutable sequence used for indexing and alignment.

Properties#

Index.values

Return an array representing the data in the Index.

Index.is_monotonic

Alias for is_monotonic_increasing.

Index.is_monotonic_increasing

Return a boolean if the values are equal or increasing.

Index.is_monotonic_decreasing

Return a boolean if the values are equal or decreasing.

Index.dtype

Return the dtype object of the underlying data.

Index.inferred_type

Return a string of the type inferred from the values.

Index.shape

Return a tuple of the shape of the underlying data.

Index.name

Return Index or MultiIndex name.

Index.names

Index.ndim

Number of dimensions of the underlying data, by definition 1.

Index.size

Return the number of elements in the underlying data.

Index.T

Return the transpose, which is by definition self.

Index.memory_usage([deep])

Memory usage of the values.

Modifying and computations#

Index.all()

Return whether all elements are Truthy.

Index.any()

Return whether any element is Truthy.

Index.copy()

Make a copy of this object.

Index.drop(labels[, errors])

Make new Index with passed list of labels deleted.

Index.drop_duplicates([keep, method])

Return Index with duplicate values removed.

Index.duplicated([keep])

Indicate duplicate index values.

Index.min([axis, skipna])

Return the minimum value of the Index.

Index.max([axis, skipna])

Return the maximum value of the Index.

Index.rename(name[, inplace])

Alter Index or MultiIndex name.

Index.value_counts([normalize, sort, ...])

Return a Series containing counts of unique values.

Compatibility with MultiIndex#

Index.set_names(names[, level, inplace])

Set Index or MultiIndex name.

Missing values#

Index.fillna([value, downcast])

Fill NA/NaN values with the specified value.

Index.dropna([how])

Return Index without NA/NaN values.

Index.isna()

Detect missing values.

Index.notna()

Detect existing (non-missing) values.

Conversion#

Index.astype(dtype[, copy])

Create an Index with values cast to dtypes.

Index.map(mapper[, na_action, dtype, ...])

Map values using an input mapping or function.

Index.to_series([index, name])

Create a Series with both index and values equal to the index keys.

Index.to_frame([index, name])

Create a DataFrame with a column containing the Index.

Sorting#

Time-specific operations#

Combining / joining / set operations#

Selecting#

Numeric Index#

CategoricalIndex#

Categorical components#

Modifying and computations#

IntervalIndex#

IntervalIndex components#

MultiIndex#

MultiIndex constructors#

MultiIndex properties#

MultiIndex components#

MultiIndex selecting#

DatetimeIndex#

Time/date components#

Selecting#

Time-specific operations#

Conversion#

Methods#

TimedeltaIndex#

Components#

Conversion#

Methods#

PeriodIndex#

Properties#

Methods#