-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Strange behavior assigning values to elements #3970
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
I responded to you e-mail..repro here this is not a bug; you are modifying a copy (which is caused by the dtype change) http://pandas.pydata.org/pandas-docs/dev/indexing.html#indexing-view-versus-copy
|
I'm confused. Where does the dtype change? I do agree that this behaves as expected
But how is this not inconsistent behavior?
In other words, why can I change an element once, but not a second time? |
sorry was thinking about another issue, dtype is not a problem here this creates a copy (so you assign to the copy rather than the frame) this is why a multi-axes assignment should use all axes in a single |
|
doesn't indexing with a sequence (or any other non slice, non tuple object that is a valid index) trigger a copy? it does with numpy |
the old |
arg there's no explanation for why fancy indexing requires a copy. maybe it's obvious but i don't see it |
I think its really related to how memory is laid out, what you are doing, etc. can it be done in an efficient manner and so for, basically implementation dependent. |
probably is because in general fancy indexing must follow the rule that any operation leading to an irregularly strided array must return a copy. in come cases (ones that are equivalent to slicing you could have views, but there's the overhead of checking whether there's an equivalent slice to the passed numpy array) |
Looks buggy to me, marked as such and labeled for 0.11.1 |
ill take a look |
Here's another good one. If I look at df["bb"] after this, I see the change (on 0.11):
|
…mixed_type silently consolidating (hurf). also fix stable sorting bug presenting on my machine
closed by #4077 |
Basically, if you create a Data
which gives:
Very strange.
Specs:
The text was updated successfully, but these errors were encountered: