-
Notifications
You must be signed in to change notification settings - Fork 300
Avoid pandas deprecation warning. #3079
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @hdyson, but what is going on here? What are we getting back by getting the first item from the pandas object? What kind of object are you expecting this to be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good question. If we go back to the original implementation here:
then it's not clear to me what the if/else is protecting against either (bearing in mind that
.baseexpands to.values.base, so the change in argument to hasattr frombasetovalueshas no affect on what pandas_obj refers to). I assumed it had a use, though, so didn't want to discard it blindly.My interpretation is that
assert_sharedcould be called with an argument of either a single pandas object (dataframe or series) or a sequence of them. The only uses seem to be a single object though, so if you'd prefer for me to discard the if/else, and go to a simpler:then I think we'll at least understand what the code is doing (and hopefully a test will fail if that breaks something).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion is appealing to be sure. I'm happy to go either way on this. On the whole, I'm pretty happy as is with the existing change. I'd like to get our Travis testing passing again before merging this, but otherwise 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little code archaeology, and it looks as though it was inherited from when pandas Series and Dataframes had a quite different data structure: 19a5487#diff-53a1661a36736be8a6017847069f7319R117 via a change to support numpy 1.7: 97ca7e9
I'll try killing it - my suspicion is that if it had some utility at one point, it probably doesn't any more.