-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Conversation
phofl
commented
Apr 2, 2021
- closes BUG: setting values with array in mixed DataFrame disregards order of indexer #40480
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
looks fine. is this a user facing change or only a patch on AM? also merge master |
This is a regression on master, so not user facing |
is the array manager failure related? |
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 |
great thanks @phofl |
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]) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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