-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
read_table with dtype=object and an int converter still returns float64 if NaN present #14558
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 is because the By the way, I suspect that you want the object type so your integers aren't cast to floats, but note that in many operations you do on such an object dtyped series, you will still get this casting behaviour + having this as object dtype will not be performant. |
Thank you for the response. API Reference does not mention the fact that
Yes, that's why I do that. In my case, |
Well, the first conversion from str to float is actually done automatically as 'N/A' by default is recognized as a missing value:
So I think this is the much easier path instead of passing a custom converter. |
OK, that's a good point. But still... From the point of view of my interfaces... Now, I have a function that converts strings to integers which exactly matches the description of the data I use and the function interface remains library-independent. If I change the signature to |
OK! Closing this then. |
A small, complete example of the issue
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: