Make new Index with passed location(-s) deleted.
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.
See also
numpy.deleteDelete any rows and column from NumPy array (ndarray).
Examples
>>> 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')
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Index.delete.html