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 Immutable ndarray implementing an ordered, sliceable set.

Attributes

Index.values return the underlying data as an ndarray
Index.is_monotonic alias for is_monotonic_increasing (deprecated)
Index.is_monotonic_increasing return if the index is monotonic increasing (only equal or
Index.is_monotonic_decreasing return if the index is monotonic decreasing (only equal or
Index.is_unique
Index.has_duplicates
Index.dtype
Index.inferred_type
Index.is_all_dates
Index.shape return a tuple of the shape of the underlying data
Index.nbytes return the number of bytes in the underlying data
Index.ndim return the number of dimensions of the underlying data,
Index.size return the number of elements in the underlying data
Index.strides return the strides of the underlying data
Index.itemsize return the size of the dtype of the item of the underlying data
Index.base return the base object if the memory of the underlying data is
Index.T return the transpose, which is by definition self
Index.memory_usage([deep]) Memory usage of my values

Modifying and Computations

Index.all(*args, **kwargs) Return whether all elements are True
Index.any(*args, **kwargs) Return whether any element is True
Index.argmin([axis]) return a ndarray of the minimum argument indexer
Index.argmax([axis]) return a ndarray of the maximum argument indexer
Index.copy([name, deep, dtype]) Make a copy of this object.
Index.delete(loc) Make new Index with passed location(-s) deleted
Index.drop(labels[, errors]) Make new Index with passed list of labels deleted
Index.drop_duplicates(*args, **kwargs) Return Index with duplicate values removed
Index.duplicated(*args, **kwargs) Return boolean np.array denoting duplicate values
Index.equals(other) Determines if two Index objects contain the same elements.
Index.factorize([sort, na_sentinel]) Encode the object as an enumerated type or categorical variable
Index.identical(other) Similar to equals, but check that other comparable attributes are
Index.insert(loc, item) Make new Index inserting new item at location.
Index.min() The minimum value of the object
Index.max() The maximum value of the object
Index.reindex(target[, method, level, ...]) Create index with target’s values (move/add/delete values as necessary)
Index.repeat(n, *args, **kwargs) Repeat elements of an Index.
Index.where(cond[, other])

New in version 0.19.0.

Index.take(indices[, axis, allow_fill, ...]) return a new %(klass)s of the values selected by the indices
Index.putmask(mask, value) return a new Index of the values set with the mask
Index.set_names(names[, level, inplace]) Set new names on index.
Index.unique() Return array of unique values in the object.
Index.nunique([dropna]) Return number of unique elements in the object.
Index.value_counts([normalize, sort, ...]) Returns object containing counts of unique values.
Index.fillna([value, downcast]) Fill NA/NaN values with the specified value
Index.dropna([how]) Return Index without NA/NaN values

Conversion

Index.astype(dtype[, copy]) Create an Index with values cast to dtypes.
Index.tolist() return a list of the Index values
Index.to_datetime([dayfirst]) For an Index containing strings or datetime.datetime objects, attempt
Index.to_series(**kwargs) Create a Series with both index and values equal to the index keys

Sorting

Index.argsort(*args, **kwargs) Returns the indices that would sort the index and its underlying data.
Index.sort_values([return_indexer, ascending]) Return sorted copy of Index

Time-specific operations

Index.shift([periods, freq]) Shift Index containing datetime objects by input number of periods and

Combining / joining / set operations

Index.append(other) Append a collection of Index options together
Index.join(other[, how, level, return_indexers]) this is an internal non-public method
Index.intersection(other) Form the intersection of two Index objects.
Index.union(other) Form the union of two Index objects and sorts if possible.
Index.difference(other) Return a new Index with elements from the index that are not in other.
Index.symmetric_difference(other[, result_name]) Compute the symmetric difference of two Index objects.

Selecting

Index.get_indexer(target[, method, limit, ...]) Compute indexer and mask for new index given the current index.
Index.get_indexer_non_unique(target) return an indexer suitable for taking from a non unique index
Index.get_level_values(level) Return vector of label values for requested level, equal to the length
Index.get_loc(key[, method, tolerance]) Get integer location for requested label
Index.get_value(series, key) Fast lookup of value from 1-dimensional ndarray.
Index.isin(values[, level]) Compute boolean array of whether each index value is found in the passed set of values.
Index.slice_indexer([start, end, step, kind]) For an ordered Index, compute the slice indexer for input labels and
Index.slice_locs([start, end, step, kind]) Compute slice locations for input labels.