-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
fix(doc): #61432 typing #61455
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
base: main
Are you sure you want to change the base?
fix(doc): #61432 typing #61455
Conversation
pandas/core/frame.py
Outdated
Column to use to make new frame's columns. | ||
index : str or object or a list of str, optional | ||
index : label or object or a list of the previous, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhshadrach IMO we should actually be using Hashable
everywhere as since it's an actual Python type unlike label
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be good with that. The only potential reason I can cook up not to is that the public API does have a number of arguments named label
or derivatives thereof. But I agree that this should be a type rather than a description of use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just fixing label
in the context of the current MR in ccf060c . For further label
s, I would rather have them fixed separatly.
Keys to group by on the pivot table index. If a list is passed, | ||
it can contain any of the other types (except list). If an array is | ||
passed, it must be the same length as the data and will be used in | ||
the same manner as column values. | ||
columns : column, Grouper, array, or list of the previous | ||
columns : column, Grouper, array, or sequence of the previous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is tuple treated the same as other sequences here? (I haven't checked)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for observing the potential danger. index
and columns
are processed by
index = _convert_by(index)
columns = _convert_by(columns)
which converts by using by = list(by)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mroeschke thank you for the approval. Wouldn't the PR fit for 2.2.4 or 2.3.0? It seems to be merely a fix to me. |
This PR will go into 3.0. No whatsnew entry is needed for this PR. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.