title: How to replace all non-NaN entries of a dataframe with 1 and all NaN with 0
body: <p>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.</p>
  
  <p>Initially I tried for-loop on each value of the dataframe which was taking too much time.</p>
  
  <p>Then I used <strong>data_new=data.subtract(data)</strong> which was meant to subtract all the values of the dataframe to itself so that I can make all the non-null values 0. 
  But an error occurred as the dataframe had multiple string entries.</p>