title: Subtract values in column from values in other column if value in other is not nan and > 0 else skip
body: <p>Here's an easy question </p>
  
  <p>I have a two columns in a 800+ row dataframe </p>
  
  <pre><code>Col  Bias
   1    -1
   2     1
   3    -0.03 
   4     0.1
   5     nan
  ....   ....
  </code></pre>
  
  <p>I want to replace col with col-bias if the value in bias is greater than 0. If it's less than 0 or nan then I want to keep the original value</p>
  
  <p>example output: </p>
  
  <pre><code>Col  
   1   
   1    
   3     
   3.9
   5
  ....  
  </code></pre>
  
  <p>I tried doing with a mask </p>
  
  <pre><code>mask=data[(data["bias"]&gt;0) | (data["bias"]!=np.nan)]
  data.loc[mask,"Col"]=data.loc[mask,"Col"]-data.loc[mask,"Bias"] 
  </code></pre>
  
  <p>But I get an error Cannot index with multidimensional key</p>
  
  <p>I feel like I can do this with df["col"].apply(lambda x: ) but am confused what x would be</p>