Skip to content

DOC: Updated convert_dtype of Series.apply #39941

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 8 commits into from
Apr 25, 2021
Merged
Changes from 6 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
3 changes: 2 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4067,7 +4067,8 @@ def apply(
Python function or NumPy ufunc to apply.
convert_dtype : bool, default True
Try to find better dtype for elementwise function results. If
False, leave as dtype=object.
False, leave as dtype=object. Note that conversion does not
happen for extension array dtypes, such as Categorical.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "Note that conversion does not happen" seems ambiguous to me. Is it that the conversion to object doesn't happen, or the conversion to find a better dtype? Maybe something like "Note that the dtype is always preserved for extension array dtypes, such as Categorical."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sukriti1 - do you want to update as per @rhshadrach 's suggestion? Sorry for having led you down the wrong route initially

args : tuple
Positional arguments passed to func after the series value.
**kwargs
Expand Down