-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC/TST: pandas.Series.str.get with dict elements supports passing hashable label #47911
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
Comments
I find it odd that arguments other than |
This does not work anyway, this returns an all nan series
|
Would |
Sure, |
I'm not sure where you managed to get that passing a dictionary is what I was referring to... This is what works just fine:
Raising an error would destroy functionality... |
You should have made this significantly clearer in your initial post. Anyway, I don’t think this should be supported |
There's literally an example of it being used with a dictionary already in the existing documentation.
What is one good reason for NOT supporting this functionality? Would you prefer apply and lambda have to be used every time you want to access dict values in a series?? Intuitively, having |
I just tried |
What is the point of |
This is the current implementation, it's obviously not meant to be
If anything, it should be:
|
Thanks @BeRT2me. Although I find this "odd usage" being under |
I agree that it's odd usage, but how |
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.str.get.html
Documentation problem
The fact that
Series.str.get
also works with Non-Numericaldict
types isn't clear in the documentation.Suggested fix for documentation
Parameters should be
int
orstr
and an example using a dictionary should be added.The text was updated successfully, but these errors were encountered: