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

modin.pandas.Index.drop¶

Index.drop(labels: Any, errors: Literal['ignore', 'raise'] = 'raise') → Index[source]¶

Make new Index with the passed list of labels deleted.

Parameters:
  • labels (array-like or scalar) –

  • errors ({'ignore', 'raise'}, default 'raise') – If ‘ignore’, suppress the error and existing labels are dropped.

Returns:

The index created will have the same type as self.

Return type:

Index

Raises:

KeyError – If all labels are not found in the selected axis

Examples

>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.drop(['a'])
Index(['b', 'c'], dtype='object')
Copy