DOC/TST: pandas.Series.str.get with dict elements supports passing hashable label
See original GitHub issuePandas version checks
- I have checked that the issue still exists on the latest versions of the docs on
main
here
Location 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-Numerical dict
types isn’t clear in the documentation.
Suggested fix for documentation
Parameters should be int
or str
and an example using a dictionary should be added.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Python hashable dicts - Stack Overflow
First, the frozenset(self) step reuses the hash values stored in the dictionary, saving unnecessary calls to hash(key) .
Read more >pyspark.pandas.series - Apache Spark
This pattern basically seeks the footer string from pandas' REPR_PATTERN ... the index will override the keys found in the dict. dtype :...
Read more >pandas/frame.py at main - GitHub
Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, ...
Read more >doctest — Test interactive Python examples — Python 3.11.1 ...
Source code: Lib/doctest.py The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to ......
Read more >pandas.core.frame — Lux 0.1.2 documentation
Pass a value of `None` instead of a string to indicate that the column ... If the keys of the passed dict should...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I find it odd that arguments other than
int
are allowed inget
since the value should indicate the position. I think instead, aValueError
should be raised if the value is not an int.You should have made this significantly clearer in your initial post.
Anyway, I don’t think this should be supported