title: Copy Row in Pandas when Condition is met into a new Dataframe
body: <p>I have been trying for a few hours on my own now without advancing much, so I come to you to help.</p>
  
  <p>Assume I have a Dataframe with Index and 4 attached columns:</p>
  
  <p><a href="https://i.stack.imgur.com/tbBUd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tbBUd.png" alt="enter image description here"></a></p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import pandas as pd
  
  data = {'df': [0, 0,0,1,0], 'cba': [np.nan, 696,1021,146,np.nan],'Availability_150': [2.26,36.2 ,70.15,40.78,11.4],'max_av_alt': [100,120 ,140,135,130]}
  df = pd.DataFrame(data=data)
  </code></pre>
  
  <p>Now, whenever there is a nan value in the cba column I want that <strong>entire</strong> row moved/copied to another DataFrame. The Goal is to have two different dataframes, one that contains all the non nan-Values of cba and one that contains all the nan-Values.</p>
  
  <p>To figure out whether I have a nan value or not I need to put in: </p>
  
  <pre class="lang-py prettyprint-override"><code>np.isnan(df_result.iloc[:,1])
  </code></pre>
  
  <p>But I have absolutely no Idea:</p>
  
  <pre class="lang-py prettyprint-override"><code>df_result_nan['cba-nan'] = df_result[df_result['cba'] == np.isnan(df_result.iloc[:,1])]
  </code></pre>
  
  <p>This gives me only nan values in the new dataframe</p>
  
  <pre class="lang-py prettyprint-override"><code>df_result_nan['cba-nan'] = np.isnan(df_result.iloc[:,1])
  </code></pre>
  
  <p>This gives me only the True/False mask for cba... </p>
  
  <p>I hope you can help me, I have been working for some time now with DataFrames but there are so many aspects I still seem to can't understand.</p>
  
  <p>Kind regards.</p>