Skip to content

DOC: Update import statement (GH21749) #45841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,20 +1418,20 @@ def take(

Examples
--------
>>> from pandas.api.extensions import take
>>> import pandas as pd

With the default ``allow_fill=False``, negative numbers indicate
positional indices from the right.

>>> take(np.array([10, 20, 30]), [0, 0, -1])
>>> pd.api.extensions.take(np.array([10, 20, 30]), [0, 0, -1])
array([10, 10, 30])

Setting ``allow_fill=True`` will place `fill_value` in those positions.

>>> take(np.array([10, 20, 30]), [0, 0, -1], allow_fill=True)
>>> pd.api.extensions.take(np.array([10, 20, 30]), [0, 0, -1], allow_fill=True)
array([10., 10., nan])

>>> take(np.array([10, 20, 30]), [0, 0, -1], allow_fill=True,
>>> pd.api.extensions.take(np.array([10, 20, 30]), [0, 0, -1], allow_fill=True,
... fill_value=-10)
array([ 10, 10, -10])
"""
Expand Down