xarray.CFTimeIndex.drop#
- CFTimeIndex.drop(labels, errors='raise')[source]#
Make new Index with passed list of labels deleted.
- Parameters:
labels (array-like or scalar) – Array-like object or a scalar value, representing the labels to be removed from the Index.
errors (
{'ignore', 'raise'}, default'raise') – If ‘ignore’, suppress error and existing labels are dropped.
- Returns:
Index– Will be same type as self, except for RangeIndex.- Raises:
KeyError – If not all of the labels are found in the selected axis
See also
Index.dropnaReturn Index without NA/NaN values.
Index.drop_duplicatesReturn Index with duplicate values removed.
Examples
>>> idx = pd.Index(["a", "b", "c"]) >>> idx.drop(["a"]) Index(['b', 'c'], dtype='str')