Skip to content

DOC: Add .map to ExtensionArray reference #52247

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 5 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.api.extensions.ExtensionArray.insert \
pandas.api.extensions.ExtensionArray.isin \
pandas.api.extensions.ExtensionArray.isna \
pandas.api.extensions.ExtensionArray.map \
pandas.api.extensions.ExtensionArray.ravel \
pandas.api.extensions.ExtensionArray.searchsorted \
pandas.api.extensions.ExtensionArray.shift \
Expand Down
1 change: 1 addition & 0 deletions doc/source/reference/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ objects.
api.extensions.ExtensionArray.insert
api.extensions.ExtensionArray.isin
api.extensions.ExtensionArray.isna
api.extensions.ExtensionArray.map
api.extensions.ExtensionArray.ravel
api.extensions.ExtensionArray.repeat
api.extensions.ExtensionArray.searchsorted
Expand Down
6 changes: 6 additions & 0 deletions pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,12 @@ def map(self, mapper, na_action=None):
The output of the mapping function applied to the array.
If the function returns a tuple with more than one element
a MultiIndex will be returned.

Examples
--------
>>> ext_arr = pd.array([1, 2, 3])
>>> ext_arr.map(str)
array(['1', '2', '3'], dtype=object)
"""
return map_array(self, mapper, na_action=na_action)

Expand Down