pandas.Index.drop — pandas 1.0.1 documentation (original) (raw)

Index. drop(self, labels, errors='raise')[source]

Make new Index with passed list of labels deleted.

Parameters

labelsarray-like

errors{‘ignore’, ‘raise’}, default ‘raise’

If ‘ignore’, suppress error and existing labels are dropped.

Returns

droppedIndex

Raises

KeyError

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