You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below causes the DataFrame internals to get confused and throws an AssertionError on print df.values. The code looks contrived, but its just a simplified version of something I was trying to do. It doesn't seem to matter whether any columns are actually renamed so I simplified that also, but the rename calls do contribute to the problem.
I think rename({}) should be allowed, as it could be you use a generated dictionary (which could be empty) to rename with. But agree that's probably where the issue lies.
To be clear, this has nothing to do with passing an empty dict to rename. I know a little about the internals now, but not enough fix this one. I believe the bug is in insert. The first rename just happens to cause ref_locs to be calculated on the blocks. The insert method fails to update these ref_locs when a new columns is inserted (block.ref_items is updated but block.ref_locs is not). The second rename then causes block.items to be calculated with incorrect ref_locs. Things go downhill from there.
pretty straightforward, was not clearing the _ref_locs (which is the indexer named ref_locs) on a unique-index (non-unique is handled separately from this); so an insert not at the end was failing
The code below causes the DataFrame internals to get confused and throws an AssertionError on
print df.values
. The code looks contrived, but its just a simplified version of something I was trying to do. It doesn't seem to matter whether any columns are actually renamed so I simplified that also, but the rename calls do contribute to the problem.The text was updated successfully, but these errors were encountered: