I have a Pandas Dataframe as shown below:
1 2 3 0 a NaN read 1 b l unread 2 c NaN read
I want to remove the
If you are converting DataFrame to JSON, NaN will give error so best solution is in this use case is to replace NaN with None. Here is how:
NaN
None
df1 = df.where((pd.notnull(df)), None)