I struggled with this issue for a long time and tried different methods.
I have a simple DataFrame as shown in the picture,

I can use the code to replace NaNwith None(not String "None"),
[![dfTest2 = dfTest.where(pd.notnull(dfTest), None)][2]][2]

I support that is NaTalso classified as "zero" because the following,
However, NaTnot replaced by None.
I was looking for answers, but I had no luck. Can anybody help?
Thanks in advance.
source
share