-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Printing None and NaN values in Pandas dataframe produces confusing results #12045
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
Labels
Milestone
Comments
Thanks for the report!
But of course, None's get converted to NaNs silently in a lot of pandas operations |
And if a cell in the bottom half of the split contains a real string, all the values in the top half are NaN:
I suppose converting Nones to NaNs is reasonable – providing it is done consistently. |
2 tasks
jreback
added a commit
to jreback/pandas
that referenced
this issue
Mar 23, 2016
closes pandas-dev#12411 closes pandas-dev#12045 closes pandas-dev#11594 closes pandas-dev#10571
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Printing a dataframe where a variable contains None values produces confusing results. Large dataframes are automatically split to print to screen. If all the values on one side of the splits are None, they are actually displayed as NaN. This can be demonstrated with the following code.
This produces the following output:
Above the split, the variable 'text' has one cell which has a genuine string ('some words'). All the None values on that side of the split are correctly displayed as 'None'. However, on the bottom part of the split, all the cells contain None values but are confusingly displayed as Nan.
Expected behaviour: All None values should be displayed as 'None' rather than 'NaN'.
The text was updated successfully, but these errors were encountered: