-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
str accessor fails for object-typed data that is actually numeric #11939
Comments
seems odd to me to do
this works for me with python2.7.x and pandas 0.17.1 |
@michaelbilow you shouldn't use object except if you have only strings. Putting numbers and such in object dtypes, while possible, is non-performant. This is reacting correctly, so closing. |
Thanks for explaining. The bigger issue is that I'm trying to do the unicode conversion (for the purpose of writing to Excel) on a huge number of completely different dataframes, to the point that it'd be a big headache to figure out what the format of each thing that ends up being labeled an object's actual dtype should be. df.convert_objects() does a very good job of figuring out what is a string and what isn't, but with it being deprecated I don't know of an efficient replacement. |
the replacements are |
I see. For my purpose, perhaps I'm better off either converting all the unknown object types using |
One thing that is important for me, since convert_objects has been deprecated (#11221), is that removing it from my code yields a bug that I've reproduced in simplified form here:
In my code, I use convert_objects to convert everything that can be converted away from an object into something else, then I use the column's dtype to check if it can be handled by the unicode decode-encode step.
The text was updated successfully, but these errors were encountered: