-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: Series.__setitem__ with Series value #51386
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
Comments
Loc is correct I think, they should align by your index (at least in the DataFrame case when setting values). If there is no reason to treat Series differently, then I'd keep the loc behavior |
So you’d deprecate the series set item behavior or keep all three as-is? |
If there is no reason that I am not aware of to keep the series set item behavior, I’d deprecate it, yes |
Possible duplicate of #37516? |
I agree doing it the same as in loc. A slightly related issue is that neither the doc string, see section "Setting values" nor the docs, see below the paragraph "Note that setting works as well:" explain that setting using series uses reindexing, it can catch some users off guard. |
In
.loc
we do a .reindex on the value Series, but not inSeries.__setitem__
(which goes throughSeries._set_values
tomgr.setitem
) using .iloc gets the__setitem__
behavior.Maybe I just need some coffee, but it isn't obvious to me what the expected behavior is here cc @phofl
The text was updated successfully, but these errors were encountered: