xorbits.pandas.Index.drop#

Index.drop(labels, errors='raise')#

Make new Index with passed list of labels deleted.

参数
  • labels (array-like or scalar) –

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

返回

Will be same type as self, except for RangeIndex.

返回类型

Index

引发

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

实际案例

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

This docstring was copied from pandas.core.indexes.base.Index.