You are viewing documentation about an older version (1.21.0). View latest version

Index¶

All supported Index APIs

Constructor

Index([data, dtype, copy, name, ...])

Properties

Index.values

Return an array representing the data in the Index.

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.is_unique

Return if the index has unique values.

Index.has_duplicates

Check if the Index has duplicate values.

Index.hasnans()

Return True if there are any NaNs.

Index.dtype

Get the dtype object of the underlying data.

Index.shape

Get a tuple of the shape of the underlying data.

Index.name

Get the index name.

Index.names

Get names of index

Index.ndim

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

Index.size

Get the number of elements in the underlying data.

Index.empty

Whether the index is empty.

Index.T

Return the transpose, which is by definition self.

Index.nlevels

Number of levels.

Snowflake Specific

Index.to_pandas(*[, statement_params])

Convert Snowpark pandas Index to pandas Index.

Modifying and computations

Index.all(*args, **kwargs)

Return whether all elements are Truthy.

Index.any(*args, **kwargs)

Return whether any element is Truthy.

Index.argmin([axis, skipna])

Return int position of the smallest value in the Series.

Index.argmax([axis, skipna])

Return int position of the largest value in the Series.

Index.copy([name, deep])

Make a copy of this object.

Index.delete()

Make new Index with passed location(-s) deleted.

Index.drop(labels[, errors])

Make new Index with the passed list of labels deleted.

Index.drop_duplicates()

Return Index with duplicate values removed.

Index.duplicated([keep])

Indicate duplicate index values.

Index.equals(other)

Determine if two Index objects are equal.

Index.identical()

Similar to equals, but checks that object attributes and types are also equal.

Index.insert()

Make new Index inserting new item at location.

Index.is_boolean()

Check if the Index only consists of booleans.

Index.is_floating()

Check if the Index is a floating type.

Index.is_integer()

Check if the Index only consists of integers.

Index.is_interval()

Check if the Index holds Interval objects.

Index.is_numeric()

Check if the Index only consists of numeric data.

Index.is_object()

Check if the Index is of the object dtype.

Index.item()

Return the first element of the underlying data as a Python scalar.

Index.min()

Return the minimum value of the Index.

Index.max()

Return the maximum value of the Index.

Index.reindex(target[, method, level, ...])

Create index with target's values.

Index.rename()

Alter Index or MultiIndex name.

Index.unique([level])

Return unique values in the index.

Index.nunique([dropna])

Return number of unique elements in the object.

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

Return a Series containing counts of unique values.

Index.array

return the array of values

Index.str

Vectorized string functions for Series and Index.

Compatibility with MultiIndex

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

Set Index name.

Missing values

Index.fillna()

Fill NA/NaN values with the specified value.

Index.dropna()

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.item()

Return the first element of the underlying data as a Python scalar.

Index.to_list()

Return a list of the values.

Index.tolist()

Return a list of the values.

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

Index.sort_values([return_indexer, ...])

Return a sorted copy of the index.

Combining / joining / set operations

Index.append()

Append a collection of Index options together.

Index.join()

Compute join_index and indexers to conform data structures to the new index.

Index.intersection(other[, sort])

Form the intersection of two Index objects.

Index.union(other[, sort])

Form the union of two Index objects.

Index.difference(other[, sort])

Return a new Index with elements of index not in other.

Selecting

Index.get_indexer_for(target)

Guaranteed return of an indexer even when non-unique.

Index.get_level_values(level)

Return an Index of values for requested level.

Index.isin()

Return a boolean array where the index values are in values.

Index.slice_indexer([start, end, step])

Compute the slice indexer for input labels and step.