Uh oh!
There was an error while loading. Please reload this page.
Add drop=True argument to isel, sel and squeeze - #1153
Conversation
Fixes GH242 This is useful for getting rid of extraneous scalar variables that arise from indexing, and in particular will resolve an issue for optional indexes: pydata#1017 (comment)
jhamman
left a comment
There was a problem hiding this comment.
This looks quite nice. Just expand the tests for squeeze a bit and we're good to go.
| expected = Dataset({'foo': 1}, {'x': 0}) | ||
| selected = data.squeeze(drop=False) | ||
| self.assertDatasetIdentical(expected, selected) | ||
There was a problem hiding this comment.
Can you add a few more tests to this section:
- squeeze empty array
- squeeze 2d array with a single element
shoyer
commented
Dec 9, 2016
Going to merge this shortly unless anyone has objections |
pwolfram
commented
Dec 9, 2016
@shoyer, I think this is really great and appreciate you doing this awesome work. I obviously have a vested interest in the |
shoyer
commented
Dec 9, 2016
Well, to be clear For |
Fixes#242
This is useful for getting rid of extraneous scalar variables that arise from
indexing, and in particular will resolve an issue for optional indexes:
#1017 (comment)