# dask.dataframe.DataFrame.pop

#### DataFrame.pop(item)

Return item and drop it from DataFrame. Raise KeyError if not found.

This docstring was copied from pandas.DataFrame.pop.

Some inconsistencies with the Dask version may exist.

The column is removed from the DataFrame and returned as a Series;
the original DataFrame is modified in place unless it was a view.

* **Parameters:**
  **item**
  : Label of column to be popped.
* **Returns:**
  Series
  : Series representing the item that is dropped.

#### SEE ALSO
[`DataFrame.drop`](dask.dataframe.DataFrame.drop.html.md#dask.dataframe.DataFrame.drop)
: Drop specified labels from rows or columns.

[`DataFrame.drop_duplicates`](dask.dataframe.DataFrame.drop_duplicates.html.md#dask.dataframe.DataFrame.drop_duplicates)
: Return DataFrame with duplicate rows removed.

### Examples

```pycon
>>> df = pd.DataFrame(
...     [
...         ("falcon", "bird", 389.0),
...         ("parrot", "bird", 24.0),
...         ("lion", "mammal", 80.5),
...         ("monkey", "mammal", np.nan),
...     ],
...     columns=("name", "class", "max_speed"),
... )
>>> df
     name   class  max_speed
0  falcon    bird      389.0
1  parrot    bird       24.0
2    lion  mammal       80.5
3  monkey  mammal        NaN
```

```pycon
>>> df.pop("class")
0      bird
1      bird
2    mammal
3    mammal
Name: class, dtype: str
```

```pycon
>>> df
     name  max_speed
0  falcon      389.0
1  parrot       24.0
2    lion       80.5
3  monkey        NaN
```

<!-- !! processed by numpydoc !! -->
