I try to replace Nan to None in pandas dataframe. It was working to use df.where(df.notnull(),None)
.
Here is the thread for this method.
Use None instead of np.nan for null values in pandas DataFrame
When I try to use the same method on another dataframe, it failed. The new dataframe is like below A NaN B C D E, the print out of the dataframe is like this:
Unnamed: 1 Unnamed: 2 Unnamed: 3 Unnamed: 4 Unnamed: 5 Unnamed: 6
0 A NaN B C D E
even when I use the working code run against the new dataframe, it failed. I just wondering is it is because in the excel, the cell format has to be certain type. Any suggestion on this?