Skip to content

BUG: Various inconsistencies in DataFrame getitem/setitem behavior (fixes #2765) #2776

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

Closed

Conversation

stephenwlin
Copy link
Contributor

fixes #2765

Note, to address __getitem__ does not reindex boolean Series key but __setitem__ does ", I have changed the __getitem__ behavior rather than the __setitem__ behavior because it is more consistent with other indexing behavior and does not break any tests...just in case, I have inserted a warning about this happening (which only triggers when a reindex is actually required)

Also, in addition to resolving the bugs, I have refactored the code to make __getitem__ and __setitem__ code paths as symmetric as possible, in order to help prevent more issues in the future.

Unit test coverage added, and performance tests show no impact

@stephenwlin
Copy link
Contributor Author

(Will avoid the new PR next time...didn't realize I could force the rebased push without breaking GitHub)

@wesm
Copy link
Member

wesm commented Feb 10, 2013

cherry picked this. thanks

@wesm wesm closed this Feb 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Various inconsistencies in DataFrame __getitem__ and __setitem__ behavior
2 participants