What's the difference between a cell value of NaN
and None
? I used df.dropna()
, which drops all NaN
but I still have a lot of None
.
I am wondering what's the difference between them and how do I get rid of None
as well?
Thanks!
What's the difference between a cell value of NaN
and None
? I used df.dropna()
, which drops all NaN
but I still have a lot of None
.
I am wondering what's the difference between them and how do I get rid of None
as well?
Thanks!
@szeitlin already gave a link to a similar question, but if you need this: you can convert a NaN to None
df1 = df.where((pd.notnull(df)), None)
or None to NaN:
import numpy as np
x = np.array(x)
x = x.astype(float)