-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
expand on different Getitem uses #60806
base: main
Are you sure you want to change the base?
Conversation
|
||
.. ipython:: python | ||
|
||
df["A"] | ||
|
||
If the label only contains letters, numbers, and underscores, you can | ||
alternatively use dot notation: |
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 "dot notation" the right term?
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.
Get attribute (getattr) notation would be more correct
|
||
.. ipython:: python | ||
|
||
df["A"] | ||
|
||
If the label only contains letters, numbers, and underscores, you can |
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.
Mind confirming I have this right?
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.
pandas allows strings that pass isidentifier
https://docs.python.org/3/library/stdtypes.html#str.isidentifier
This is confusing to my students, so figured it would be helpful to call it out explicitly.
closes #xxxx (Replace xxxx with the GitHub issue number)added andpassed if fixing a bug or adding a new featureAdded type annotations to new arguments/methods/functions.Added an entry in the latestdoc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.