pandas.Index.drop
pandas 3.1.1 · Index objects · method
Remove rows or columns by label. Specify columns= to make column removal explicit.
Call syntax
Index.drop(labels, errors='raise')Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
labels |
Required Positional or keyword |
array-like or scalar Provide the labels used for selecting rows, renaming entries, or naming bins. |
errors |
Optional Positional or keyword Default 'raise' |
{'ignore', 'raise'} Choose how to handle invalid input or failed operations. The available options depend on the API. |
Returns
Index