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: Inconsistent use of "column-wise" and "row-wise" #43128

Closed
ianozsvald opened this issue Aug 20, 2021 · 2 comments · Fixed by #47237
Closed

DOC: Inconsistent use of "column-wise" and "row-wise" #43128

ianozsvald opened this issue Aug 20, 2021 · 2 comments · Fixed by #47237
Assignees
Labels

Comments

@ianozsvald
Copy link
Contributor

5 Pandas docstrings discuss the axis argument with one use of row/column-wise, 2 docstrings use an opposite meaning (and possibly more examples exist, I picked these up using Google & DuckDuckGo).

I believe the first 5 usages are in agreement with the Numpy usage.

Examples of axis: Equals 0 or ‘index’ for row-wise, 1 or ‘columns’ for column-wise (i.e. 0 is row-wise):

Examples of The axis to use. 0 or ‘index’ to compute column-wise, 1 or ‘columns’ for row-wise (i.e. 0 is column-wise):

For Series.all the examples down the page note Default behaviour (i.e. axis=0) checks if column-wise values all return True. and Specify axis='columns' (or axis=1) to check if row-wise values all return True..

On Numpy I can't find many examples, the few that I find are consistent with the first (5 case) usage:

Suggested fix for documentation

I think that the 2 opposing cases (corrwith and Series.all) don't need to have the inverted explanation so I think that reversing them to fit the general case makes sense, but maybe I'm missing something?

@ianozsvald ianozsvald added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 20, 2021
@mattharrison
Copy link

On a semi-related note (since this isn't the axis parameter), the behavior of the normalize parameter for pd.crosstab also accepts 'columns' or 'index'. When you pass 'columns', it doesn't normalize across the columns, but down each one. I understand the behavior, but it seems inconsistent. 🤷‍♀️😢

@mroeschke mroeschke removed the Needs Triage Issue that has not been reviewed by a pandas team member label Aug 22, 2021
@ianozsvald ianozsvald changed the title DOC: Inconsistent use of "column-wise" and "row-wise" (and I think the majority use conflicts with numpy's docs) DOC: Inconsistent use of "column-wise" and "row-wise" Aug 22, 2021
@jackgoldsmith4
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants