You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Full database
-------------
id text
0 1 some words
1 2 None
2 3 None
3 4 None
4 5 None
5 6 None
6 7 None
7 8 None
8 9 None
9 10 None
Split database
--------------
id text
0 1 some words
1 2 None
2 3 None
3 4 None
.. .. ...
6 7 NaN
7 8 NaN
8 9 NaN
9 10 NaN
[10 rows x 2 columns]
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'.
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: