pandas 1.4.2

ParametersReturns
delete(self: '_IndexT', loc) -> '_IndexT'

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.

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

See Also

numpy.delete

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

Examples

This example is valid syntax, but we were not able to check execution
>>> idx = pd.Index(['a', 'b', 'c'])
... idx.delete(1) Index(['a', 'c'], dtype='object')
This example is valid syntax, but we were not able to check execution
>>> idx = pd.Index(['a', 'b', 'c'])
... idx.delete([0, 2]) Index(['b'], dtype='object')
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/indexes/base.py#6521
type: <class 'function'>
Commit: