title: How to subset a dataframe based on rows that exist in multiple other dataframes?
body: <p>I have created multiple control dataframes (<code>pos_control_df</code>, <code>neg_control_df</code>) based on columns of the original <code>df</code> dataframe.</p>
  <pre><code>import pandas as pd
  import numpy as np
  
  # Isolate the control samples
  ## Samples are &quot;control&quot; if:
  ## (i) Positive control: &quot;mrna_assignment&quot; column contains substring &quot;pos_control&quot;
  ## (ii) Negative control: &quot;mrna_assignment&quot; column contains substring &quot;neg_control&quot;
  ## (iii) standard Affymetrix spike control probeset:  &quot;category&quot; column contains substring &quot;control-&gt;affx&quot;
  ## (iv) antigenomic background probes: &quot;category&quot; column contains substring &quot;control-&gt;bgp-&gt;antigenomic&quot;
  
  pos_neg_ctl_df = df.loc[((df[&quot;mrna_assignment&quot;].str.contains(&quot;pos_control&quot;)) | (df[&quot;mrna_assignment&quot;].str.contains(&quot;neg_control&quot;))),:] 
  
  probe_ctl_df = df.loc[((df[&quot;category&quot;].str.contains(&quot;control-&gt;affx&quot;)) | (df[&quot;category&quot;].str.contains(&quot;control-&gt;bgp-&gt;antigenomic&quot;))),:] 
  </code></pre>
  <p>Now, I want to create <code>sample_df</code> by subsetting <code>df</code> to keep samples that don't exist in either <code>pos_neg_ctl_df</code> or <code>probe_ctl_df</code>.</p>
  <p>Now, I want to create <code>sample_df</code> by subsetting <code>df</code> by keeping only rows that are not in any of the control dataframes.</p>
  <p>Here, I'm able to subset the <code>df</code> by the <code>pos_neg_ctl_df</code> dataframe. But I'm not sure how to simultaneously subset <code>df</code> by multiple dataframes (i.e., <code>pos_neg_ctl_df</code> or <code>probe_ctl_df</code> dataframes).</p>
  <pre><code>merged_posneg_control = df.reset_index().merge(pos_neg_ctl_df, how='left', indicator=True)
  sample_df = merged_posneg_control[merged_posneg_control['_merge']=='left_only']
  sample_df = sample_df.set_index(&quot;Gene Symbol&quot;)
  </code></pre>