title: How to combine two columns in a df as a condition in np.where to check if nan in calculating new column
body: <p>I want to check if either column contains a nan and if so the value in my new column to be &quot;na&quot; else 1.</p>
  <p>I was able to get my code to work when checking a single column using .isnull() but I am unsure how to combine two. I tried using or as seen below. But it did not work. I know I can make the code a bit messy by testing one condition and then checking the next and from that producing the outcome I want but was hoping to make the code a bit cleaner by using some sort of any, or etc function instead but I do not know how to do that.</p>
  <pre><code>temp_df[&quot;xl&quot;] = np.where(temp_df[&quot;x&quot;].isnull() or temp_df[&quot;y&quot;].isnull(), &quot;na&quot;,1)
  </code></pre>