-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
BUG: Allow unsigned integer indexing, fixes #1405 #1406
Conversation
Permit indexing with unsigned integers. This should fix pydata#1405.
Indeed, looks like this should do the trick, but we definitely need a regression test before merging this (also a bugfix note, see the checklist in your first comment). |
Perhaps I was too fast, I edited it directly in github. |
@gerritholl when files are edited on github it creates a branch on your fork (here gerritholl:patch-3) which you can clone locally and update with the usual workflow. |
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.
@gerritholl - thanks for the fix here. Do you think you'll come back around to finish this PR up? Otherwise, I'll mark as "Contributions Welcome".
@@ -58,7 +58,7 @@ def canonicalize(indexer): | |||
'1d arrays') | |||
if indexer.dtype.kind == 'b': | |||
indexer, = np.nonzero(indexer) | |||
elif indexer.dtype.kind != 'i': | |||
elif indexer.dtype.kind not in 'ui': |
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.
nit: this feels too cute. I suggest writing this as:
elif indexer.dtype.kind not in ['u', 'i']:
I may make time for it later |
I have an updated version of this PR up at #1544 |
I'm closing in favor of #1473 |
Permit indexing with unsigned integers. This should fix #1405.
git diff upstream/master | flake8 --diff