title: Remove rows from dataframes not present in dataframes in dictionary
body: <p>I have a hundreds pandas dataframes such as these:</p>
  <pre><code>Df1 = 
      MD    A    B    C  
      r1    6    3    9   
      r2    2    1    1  
      r3    5    7    2  
      r4    8    2    0
  
  Df2 = 
      MD    A    B    C  
      r1    1    7    1  
      r2    6    3    0  
      r3    3    1    8
      r4    1    7    4
  </code></pre>
  <p>I also have one dictionary like this (except with a number of keys and values to reflect the number of dataframes):</p>
  <pre><code>Dict = {'D1', MD
                r1
                r4
          [2 rows x 1 columns]
          'D2', MD
                r1
                r2
                r3
          [3 rows x 1 columns]}
    
  </code></pre>
  <p>What I need is a way to go through the dictionary, and for each dataframe and corresponding key (I.e. Df1 and D1, and Df2 and D2), remove the rows not present in the &quot;dictionary-value dataframe&quot;.</p>
  <p>So for Df1, I need to go to the key D1 and remove the rows that are not in the dataframe for this key. That is, remove r2 and r3 from Df1.</p>
  <p>So the result I want would be:</p>
  <pre><code>Df1 = 
      MD    A    B    C  
      r1    6    3    9   
      r4    8    2    0
  
  Df2 = 
      MD    A    B    C  
      r1    1    7    1  
      r2    6    3    0  
      r3    3    1    8
  </code></pre>
  <p>Any help is greatly appreciated!</p>
  <p>PS. If it is easier to keep the rows instead of removing them, that would also be helpful!</p>