-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Updating a DataFrame by iteratively indexing into a columns #7084
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
This kind of looks like a regression. I say "kind of", because you should avoid this kind of indexing like the plague but also because we like to keep backcompat and breaking this is kind against our de facto rules. I'll call this a bug. |
For future reference, instead of out[row['C']][six:eix] = out[row['C']][six:eix] + row['D'] do out.loc[six:eix, row['C']] += row['D'] |
this is chained indexing and hence is not guaranteed to work not a bug |
@jreback just curious, but how is it possible that |
Isn't this a caching bug? |
@cpcloud nice one! thanks a ton. |
@Jenders74 have a read here, you should never use chain indexing http://pandas-docs.github.io/pandas-docs-travis/indexing.html#indexing-view-versus-copy that said this was a bug, thanks for reporting closed by #7087 |
I am initializing a DataFrame with 0 and then update it by iteratively indexing into indvidual columns. The behavior of my code has changed with pandas 0.13.0 such that resulting DataFrame out[['A']] remains 0 but series out['A'] has the correct values:
Is this a bug?
The text was updated successfully, but these errors were encountered: