You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
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:
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?
The text was updated successfully, but these errors were encountered:
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. 🤷♀️😢
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
5 Pandas docstrings discuss the
axis
argument with one use ofrow/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 noteDefault behaviour (i.e. axis=0) checks if column-wise values all return True.
andSpecify 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:
horizontally (column-wise)...equivalent to split with axis=1
vertically (row-wise)... equivalent to split with axis=0 (default)
Suggested fix for documentation
I think that the 2 opposing cases (
corrwith
andSeries.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?The text was updated successfully, but these errors were encountered: