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

Bug in loc not ordering rhs correctly for mixed indexer #40764

Merged
merged 6 commits into from
Apr 13, 2021

Conversation

phofl
Copy link
Member

@phofl phofl commented Apr 2, 2021

@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 Apr 2, 2021
@jreback jreback added this to the 1.3 milestone Apr 9, 2021
@jreback
Copy link
Contributor

jreback commented Apr 9, 2021

looks fine. is this a user facing change or only a patch on AM?

also merge master

@phofl
Copy link
Member Author

phofl commented Apr 9, 2021

This is a regression on master, so not user facing

@jreback
Copy link
Contributor

jreback commented Apr 9, 2021

is the array manager failure related?

@phofl
Copy link
Member Author

phofl commented Apr 9, 2021

Sorry, did not scroll down up enough the last time.

This fixes part of the array manager bug, but not the overwriting, so adjusted the test accordingly

@jreback jreback merged commit a5b666c into pandas-dev:master Apr 13, 2021
@jreback
Copy link
Contributor

jreback commented Apr 13, 2021

great thanks @phofl

@phofl phofl deleted the 40480 branch April 14, 2021 20:15
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
df = DataFrame(index=[1, 2, 3], columns=["A", "B"], dtype=float)
df["B"] = "string"
df.loc[slice(3, 0, -1), "A"] = np.array([1, 2, 3], dtype="int64")
expected = DataFrame({"A": [3, 2, 1], "B": "string"}, index=[1, 2, 3])
Copy link
Member

Choose a reason for hiding this comment

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

@phofl AFAICT the setting on L619 should be done in-place, so expected["A"] should still be float dtype. is the changed dtype relevant here?

Copy link
Member

Choose a reason for hiding this comment

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

ditto for test_loc_setitem_frame_with_reindex_mixed

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: setting values with array in mixed DataFrame disregards order of indexer
3 participants