Skip to main content
`Ctrl`+`K`

# pandas.Index.delete

Index.delete(loc)

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

  Returns a new Index with the entries at the given positional location(s) removed. The original Index is not modified.

  Parameters:
    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.

  Returns:
    Index

      Will be same type as self, except for RangeIndex.

  See also

  `numpy.delete`

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

  Examples

      >>> idx = pd.Index(["a", "b", "c"])
      >>> idx.delete(1)
      Index(['a', 'c'], dtype='str')

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