I have a dataframe with 71 columns and 30597 rows. I want to replace all non-nan entries with 1 and the nan values with 0.
Initially I tried for-loop on each value of th
Use: df.fillna(0)
df.fillna(0)
to fill NaN with 0.