title: Pandas - Remove rows based on combinations of NaN values
body: <p>I have a data frame that looks something like this:</p>
  
  <pre><code>NUM   A      B        C      D        E        F
  p1    NaN    -1.183   NaN    NaN      NaN      1.829711
  p5    NaN    NaN      NaN    NaN      1.267   -1.552721
  p9    1.138  NaN      NaN    -1.179   NaN      1.227306
  </code></pre>
  
  <p>There is always a non-NaN value in: column F and at least one other column A-E.</p>
  
  <p>I want to create a sub-table containing only those rows which contain certain combinations of non-NaN values in columns. There are a number of these desired combinations including doublets and triplets. Here are examples of three such combinations I want to pull:</p>
  
  <ol>
  <li>Rows which contain non-NaN values in columns A &amp; B</li>
  <li>Rows which contain non-NaN values in C &amp; D</li>
  <li>Rows which contain non-NaN values in A &amp; B &amp; C</li>
  </ol>
  
  <p>I already know about the np.isfinite and pd.notnull commands from this <a href="https://stackoverflow.com/questions/13413590/how-to-drop-rows-of-pandas-dataframe-whose-value-of-certain-column-is-nan">question</a> but I do not know how to apply them to combinations of columns. </p>
  
  <p>Also, once I have a list of commands for removing rows that do not match one of my desired combinations, I do not know how to tell Pandas to remove rows ONLY if they do not match any of the desired combinations. </p>