xorbits.pandas.Index.delete#

Index.delete(loc) None[源代码]#

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

参数

loc (int or list of int) – Location of item(-s) which will be deleted. Use a list of locations to delete more than one value at the same time.

返回

Will be same type as self, except for RangeIndex.

返回类型

Index

参见

numpy.delete

Delete any rows and column from NumPy array (ndarray).

实际案例

>>> idx = pd.Index(['a', 'b', 'c'])  
>>> idx.delete(1)  
Index(['a', 'c'], dtype='object')
>>> idx = pd.Index(['a', 'b', 'c'])  
>>> idx.delete([0, 2])  
Index(['b'], dtype='object')

警告

This method has not been implemented yet. Xorbits will try to execute it with pandas.

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