Skip to content
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

REGR: loc not working with NamedTuple #48178

Merged
merged 2 commits into from Aug 23, 2022
Merged

Conversation

phofl
Copy link
Member

@phofl phofl commented Aug 20, 2022

@phofl phofl added Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version labels Aug 20, 2022
@phofl phofl added this to the 1.4.4 milestone Aug 20, 2022
@tomaarsen
Copy link
Contributor

This fix might be worth repeating around here to fix the same issue for iloc:

pandas/pandas/core/indexing.py

Lines 1605 to 1609 in a2a939e

if is_iterator(key):
key = list(key)
if isinstance(key, list):
key = np.asarray(key)

See #48124 (comment) for a reproducible example.

@phofl
Copy link
Member Author

phofl commented Aug 21, 2022

Not a regression, so will keep this out of this pr

@tomaarsen
Copy link
Contributor

Understandable, #48188 has been made to tackle the iloc issue

doc/source/whatsnew/v1.4.4.rst Outdated Show resolved Hide resolved
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @phofl lgtm.

can tidy the release notes here (or in a follow-up)

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@phofl
Copy link
Member Author

phofl commented Aug 23, 2022

Committed the changes

@simonjayhawkins
Copy link
Member

cool. can merge on green.

@simonjayhawkins simonjayhawkins merged commit 53d3c45 into pandas-dev:main Aug 23, 2022
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Aug 23, 2022
simonjayhawkins pushed a commit that referenced this pull request Aug 23, 2022
…uple) (#48217)

Backport PR #48178: REGR: loc not working with NamedTuple

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
@phofl phofl deleted the 48124 branch August 30, 2022 08:05
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: using NamedTuples with .loc works only sometimes
5 participants