-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Pandas 1.0 no longer handles numpy.str_
s as catgories
#31499
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
This changed from 0.25.3? Are you able to pin down what change caused it? |
Yes, in 0.25.3 this worked. At least, it gives a categorical with object categories with those numpy strings (but with Series constructor, we also preserve the numpy strings, and don't convert to python strings, so that seems the "expected" behaviour). |
My guess is that it's related to #30419 which changed |
maybe if we're lucky it will be good enough to change L706 in hashtable_class_helper.pxi.in from |
Yeah, it’s kinda shitty. I think implicit conversation would be better than a hard-to-interpret error here though. |
Code Sample
Problem description
I know that having a list of
numpy.str_
s seems weird, but it easily happens when you use non-numpy algorithms on numpy arrays (e.g.natsort.natsorted
in our case), or via comprehensions or so:Expected Output
A normal pd.Categorical
Pandas version
pandas 1.0
The text was updated successfully, but these errors were encountered: