Skip to content

DOC: Updated the returns for DataFrame.any/all to return either a Series or scalar #57817

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12022,8 +12022,8 @@ def last_valid_index(self) -> Hashable:

Returns
-------
{name1} or {name2}
If level is specified, then, {name2} is returned; otherwise, {name1}
{name1} or scalar
If axis=None, then a scalar boolean is returned. Otherwise, a {name1} is returned with index matching the index argument.
Copy link
Member

Choose a reason for hiding this comment

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

There shouldn't be a period at the end. See how it renders here: https://pandas.pydata.org/preview/pandas-dev/pandas/57817/docs/reference/api/pandas.Series.any.html#pandas.Series.any

Also, the type is scalar or scalar. I think this already happens in the docs, but since you are already changing this, maybe worth leaving it well.

Also note that while the discussion is not settle, people seems to be happy to stop reusing docstrings. So if you want to replicate the docstring for each method, that would be ok.

is returned.

{see_also}
Expand Down