pandas.Series.pop — pandas 2.2.3 documentation (original) (raw)

Series.pop(item)[source]#

Return item and drops from series. Raise KeyError if not found.

Parameters:

itemlabel

Index of the element that needs to be removed.

Returns:

Value that is popped from series.

Examples

ser = pd.Series([1, 2, 3])

ser 1 2 2 3 dtype: int64