pandas.Index.difference
pandas 3.1.1 · Index objects · method
Get the labels in this index that are absent from the other collection.
Call syntax
Index.difference(other, sort=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
other |
Required Positional or keyword |
Index or array-like Supply the second object or value used in the operation. |
sort |
Optional Positional or keyword Default None |
bool or None Choose whether the resulting labels or groups are sorted where supported. |
Returns
Index