If I have a variable with missings, how do I assign them as NaNs in python?
I've tried the following but it's returning an empty dataframe:
data_2017_18.income=np.nan
Much appreciated.
If I have a variable with missings, how do I assign them as NaNs in python?
I've tried the following but it's returning an empty dataframe:
data_2017_18.income=np.nan
Much appreciated.
You can use float("nan")
to get a "not a number" (NaN) value.