modin.pandas.Series.drop¶
- Series.drop(labels=None, *, axis=0, index=None, columns=None, level=None, inplace=False, errors='raise') Self[source]¶
Return Series with specified index labels removed.
Remove elements of a Series based on specifying the index labels. When using a MultiIndex, labels on different levels can be removed by specifying the level.
- Parameters:
labels (single label or list-like) – Index labels to drop.
axis ({0 or 'index'}) – Unused. Parameter needed for compatibility with DataFrame.
index (single label or list-like) – Redundant for application on Series, but ‘index’ can be used instead of ‘labels’.
columns (single label or list-like) – No change is made to the Series; use ‘index’ or ‘labels’ instead.
level (int or level name, optional) – For MultiIndex, level for which the labels will be removed.
inplace (bool, default False) – If True, do operation inplace and return None.
errors ({'ignore', 'raise'}, default 'raise') – If ‘ignore’, suppress error and only existing labels are dropped.
- Returns:
Series with specified index labels removed or None if
inplace=True.- Return type:
Snowpark pandas
Seriesor None- Raises:
KeyError – If none of the labels are found in the index.
See also
Series.reindexReturn only specified index labels of Series.
Series.dropnaReturn series without null values.
Series.drop_duplicatesReturn Series with duplicate values removed.
DataFrame.dropDrop specified labels from rows or columns.
Examples
Drop labels B en C
Drop 2nd level label in MultiIndex Series