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.
|
Immutable sequence used for indexing and alignment. |
Properties#
Return an array representing the data in the Index. |
|
Return a boolean if the values are equal or increasing. |
|
Return a boolean if the values are equal or decreasing. |
|
Return the dtype object of the underlying data. |
|
Return a string of the type inferred from the values. |
|
Return a tuple of the shape of the underlying data. |
|
Return Index or MultiIndex name. |
|
Number of dimensions of the underlying data, by definition 1. |
|
Return the number of elements in the underlying data. |
|
Return the transpose, which is by definition self. |
|
|
Memory usage of the values. |
Modifying and computations#
Return whether all elements are Truthy. |
|
Return whether any element is Truthy. |
|
|
Return int position of the smallest value in the Series. |
|
Return int position of the largest value in the Series. |
Make a copy of this object. |
|
|
Make new Index with passed location(-s) deleted. |
|
Make new Index with passed list of labels deleted. |
|
Return Index with duplicate values removed. |
|
Indicate duplicate index values. |
|
Determine if two Index object are equal. |
|
Encode the object as an enumerated type or categorical variable. |
|
Similar to equals, but checks that object attributes and types are also equal. |
|
Make new Index inserting new item at location. |
|
More flexible, faster check like |
Check if the Index only consists of booleans. |
|
Check if the Index holds categorical data. |
|
Check if the Index is a floating type. |
|
Check if the Index only consists of integers. |
|
Check if the Index holds Interval objects. |
|
Check if the Index only consists of numeric data. |
|
Check if the Index is of the object dtype. |
|
|
Return the minimum value of the Index. |
|
Return the maximum value of the Index. |
|
Create index with target's values. |
|
Alter Index or MultiIndex name. |
|
Repeat elements of a Index. |
|
Replace values where the condition is False. |
|
Return a new Index of the values selected by the indices. |
|
Return a new Index of the values set with the mask. |
|
Return unique values in the index. |
|
Return number of unique elements in the object. |
|
Return a Series containing counts of unique values. |
Compatibility with MultiIndex#
|
Set Index or MultiIndex name. |
|
Return index with requested level(s) removed. |
Missing values#
|
Fill NA/NaN values with the specified value. |
|
Return Index without NA/NaN values. |
Detect missing values. |
|
Detect existing (non-missing) values. |
Conversion#
|
Create an Index with values cast to dtypes. |
Return the first element of the underlying data as a Python scalar. |
|
|
Map values using an input mapping or function. |
|
Return a view on self. |
Return a list of the values. |
|
|
Create a Series with both index and values equal to the index keys. |
|
Create a DataFrame with a column containing the Index. |
|
Sorting#
|
Return the integer indices that would sort the index. |
|
Find indices where elements should be inserted to maintain order. |
|
Return a sorted copy of the index. |
Time-specific operations#
|
Shift index by desired number of time frequency increments. |
Combining / joining / set operations#
|
Append a collection of Index options together. |
Compute join_index and indexers to conform data structures to the new index. |
|
|
Form the intersection of two Index objects. |
|
Form the union of two Index objects. |
|
Return a new Index with elements of index not in other. |
|
Compute the symmetric difference of two Index objects. |
Selecting#
|
Return the label from the index, or, if not present, the previous one. |
|
Return the locations (indices) of labels in the index. |
|
Compute indexer and mask for new index given the current index. |
|
Guaranteed return of an indexer even when non-unique. |
|
Compute indexer and mask for new index given the current index. |
|
Return an Index of values for requested level. |
|
Get integer location, slice or boolean mask for requested label. |
|
Calculate slice bound that corresponds to given label. |
|
Return a boolean array where the index values are in values. |
|
Compute the slice indexer for input labels and step. |
|
Compute slice locations for input labels. |