{{ message }}
FIX: let pandas IndexInt64 work for boxplot - #13398
Merged
Merged
Conversation
jklymak
force-pushed
the
fix-boxplot-pandas
branch
from
February 10, 2019 03:28
1e7caa0 to
28bc931
Compare
Member
Author
NelleV
reviewed
Feb 10, 2019
| positions = list(range(1, N + 1)) | ||
| elif len(positions) != N: | ||
| raise ValueError(datashape_message.format("positions")) | ||
| positions = np.array(positions) |
Member
There was a problem hiding this comment.
This is a good fix for the case described in the ticket, but I think the code will continue raising obscure error when positions are not numbers. Can you add a check after this line about the dtype of the array being a number? Maybe something like:
if not isinstance(positions.dtype, numbers.Number):
raise TypeError("positions should be a iterable of dtype number, but found dtype %s" % blah blah blah.)When we end up supporting something else than numbers, this can be updated.
Member
Author
There was a problem hiding this comment.
I couldn't quite get that check to work; I had to check the first element. But if there is a better way, let me know.
jklymak
force-pushed
the
fix-boxplot-pandas
branch
from
February 11, 2019 21:48
ef7afc4 to
728106a
Compare
dstansby
approved these changes
Feb 19, 2019
Member
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

PR Summary
Closes #10022 by casting the list of positions to an array as suggested by @tacaswell
PR Checklist