question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC/TST: pandas.Series.str.get with dict elements supports passing hashable label

See original GitHub issue

Pandas 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:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mroeschkecommented, Aug 1, 2022

I find it odd that arguments other than int are allowed in get since the value should indicate the position. I think instead, a ValueError should be raised if the value is not an int.

1reaction
phoflcommented, Aug 1, 2022

You should have made this significantly clearer in your initial post.

Anyway, I don’t think this should be supported

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found