-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: dtype=str in 0.23.0 converts NaN to 'n' #22477
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
Thanks for the report! That certainly seems like a regression. I seem to remember we had some issues about it last year, but can't directly find it. cc @toobaz you worked a bit on the series constructor and related things, not sure if this is related |
Hello, is this related or a different issue?
I think this prevents me from loading HDF-Files that were written with earlier pandas versions. Accessing certain HDF-nodes I get an ValueError leading back to this line in pytables.py: data = Series(data).str.decode(encoding, errors=errors).values Its raising because the original "data" (numpy-ndarray-object) was something like the above |
git bisect reveals this as the first bad commit: c8fcfcb The bisect script did just this
|
@abrakababra that looks different. @kokes thanks (and sorry). I think the issue is that |
Hey everyone! |
Add a check so if the dtype is str is will create an empty array type object and then pass the values. Add test for an empty series. To chech that it fills the series with NaN and not with 'n'. Also add a test for cases that no string values are given.
Add a check so if the dtype is str is will create an empty array type object and then pass the values. Add test for an empty series. To chech that it fills the series with NaN and not with 'n'. Also add a test for cases that no string values are given.
Add a check so if the dtype is str is will create an empty array type object and then pass the values. Add test for an empty series. To chech that it fills the series with NaN and not with 'n'. Also add a test for cases that no string values are given.
Add a check so if the dtype is str is will create an empty array type object and then pass the values. Add test for an empty series. To chech that it fills the series with NaN and not with 'n'. Also add a test for cases that no string values are given.
More specifically the cases that seem to have an issue are when: - the series in empty - it's a single element series * Closes #22477
More specifically the cases that seem to have an issue are when: - the series in empty - it's a single element series * Closes pandas-dev#22477
More specifically the cases that seem to have an issue are when: - the series in empty - it's a single element series * Closes pandas-dev#22477
Before I upgraded pandas to 0.23.0, pd.Series(dtype=str, index=range(5)) gave me a series filled with NaN values. However, with this recent upgrade, dtype=str converts null values to lower case letter ’n’. I’m appending the normal null value series output below as a comparison.
The text was updated successfully, but these errors were encountered: