-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Categorical[idx].codes != Categorical.codes[idx] #9469
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
Comments
It seems that |
The indexer is coerced to the same dtype as the codes ( can you show a construction for y? |
needless to say this is prob not tested well. and prob not used very much as this is almost always used from a Series. (this is somewhat legacy code) |
I'm trying to make a MWE. |
|
In my case, |
Not obvious to me why numpy would care between dtype of indexer and the dtype of the array. AFAIK, it just needs to be any integer type or boolean, no? |
Removing the casting everything seems to work fine for me.
|
fixed in #9470 (just had to remove coercion), but didn't work for both setting and getting. IIRC this was a problem on windows as it complained when trying to index (but maybe I am remembering incorrectly). I agree it should work. If you can test on windows would be great, otherwise I can do next week. |
I'll see if I can't find a windows box around. If not, can look in to it one night. Any min. numpy version? |
numpy 1.7 is our min as of 0.15.0 |
I tested it on Windows, and at least with Windows 7, 64bit, python 2.7 and numpy 1.9 this works (and the bug is fixed) |
Fantastic. Thanks @jorisvandenbossche Is this worth a |
well considering it wasn't noticed till 3 mo after 0,15.2 no 0.16.0 is schedule somewhat soon anyhow |
Well, I lost about 2 weeks of work bc. I was silently working with garbage. |
I'm unable to isolate this, but maybe this rings a bell for someone. It took me a long time to find the source of error in my code. I don't think this is intentional, and if so, is pretty dangerous.
The text was updated successfully, but these errors were encountered: