Skip to content
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

DOC: unclear kwarg null_counts #36805

Closed
ivanovmg opened this issue Oct 2, 2020 · 3 comments · Fixed by #37999
Closed

DOC: unclear kwarg null_counts #36805

ivanovmg opened this issue Oct 2, 2020 · 3 comments · Fixed by #37999
Labels
API - Consistency Internal Consistency of API/Behavior Docs Needs Triage Issue that has not been reviewed by a pandas team member
Milestone

Comments

@ivanovmg
Copy link
Member

ivanovmg commented Oct 2, 2020

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.info.html?highlight=info#pandas.DataFrame.info

Documentation problem

Keyword null_counts from its name may be considered as a need to count null items.
However, the documentation explains that is quite the opposite - count non-null items.
I suggest to rename it with show_counts and maintain the old behavior.

Suggested fix for documentation

Replace null_counts with show_counts.
It will make it more clear what this kwarg means without even the need to read docs.

API

It the suggested rename is implemented, then need to start deprecation of kwarg null_counts.

@ivanovmg ivanovmg added Docs Needs Triage Issue that has not been reviewed by a pandas team member API - Consistency Internal Consistency of API/Behavior labels Oct 2, 2020
@MarcoGorelli
Copy link
Member

I agree that it's a bit of a misnomer, but wouldn't renaming potentially break people's code?

@ivanovmg
Copy link
Member Author

ivanovmg commented Oct 2, 2020

I suggest smooth transition to the new kwarg via the deprecation process, so that nobody's code gets broken right away.
We can start with throwing warnings that the old kwarg is deprecated and in version X.X will be removed.

@MarcoGorelli
Copy link
Member

Might be worth it actually - I think people are only likely to use .info in an interactive session, rather than as part of production code, so perhaps it is worth going through the deprecation process to make this argument clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Docs Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants