title: Delete rows not present in all DataFrame in pandas
body: <h1>Background</h1>
  
  <p>There is 5 DataFrames, I will call them <code>b1, b2, b3, b4, b5</code>.</p>
  
  <p>They have data structure which consists of the columns <code>['Date', 'Value']</code> </p>
  
  <p>I got the data from 2014 to 2015.</p>
  
  <h1>Problem</h1>
  
  <p>Every DataFrame has different date counting system. So, I want to get rid of the rows in the DataFrames which have non-matching dates.</p>
  
  <p>How can I do that?</p>
  
  <h1>What I have tried</h1>
  
  <p>So, I will delete all the data if <code>Date</code> of the data is not included in all DataFrames: <code>b1, b2, b3, b4, b5</code></p>
  
  <p>This works for the first time</p>
  
  <pre><code>for i in range(len(b2.index)):
      k = 0
      for j in range(len(b1.index)):
          if b2['Date'][i] == b1['Date'][j]:
              k = k+1
          else:
              k = k
      if k == 1:
          pass
      if k == 0:
          b2 = b2.drop([i])
  </code></pre>
  
  <p>But, after that I excute this code one more time after I did that, there would be some error like this:</p>
  
  <blockquote>
    <p>KeyError    Traceback (most recent call last)
     in ()
    2k = 0
    3for j in range(len(b2.index)):
    ----> 4    if b1['Date'][i] == b2['Date'][j]:
    5   k = k+1
    6    else:</p>
    
    <p>C:\Users\cms\Anaconda\lib\site-packages\pandas\core\series.pyc in <strong>getitem</strong>(self, key)
       519def <strong>getitem</strong>(self, key):
       520    try:
    --> 521   result = self.index.get_value(self, key)
       522 
       523   if not np.isscalar(result):</p>
    
    <p>C:\Users\cms\Anaconda\lib\site-packages\pandas\core\index.pyc in get_value(self, series, key)
      1593 
      1594    try:
    -> 1595   return self._engine.get_value(s, k)
      1596    except KeyError as e1:
      1597   if len(self) > 0 and self.inferred_type in ['integer','boolean']:</p>
    
    <p>pandas\index.pyx in pandas.index.IndexEngine.get_value (pandas\index.c:3113)()</p>
    
    <p>pandas\index.pyx in pandas.index.IndexEngine.get_value (pandas\index.c:2844)()</p>
    
    <p>pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:3704)()</p>
    
    <p>pandas\hashtable.pyx in pandas.hashtable.Int64HashTable.get_item (pandas\hashtable.c:7224)()</p>
    
    <p>pandas\hashtable.pyx in pandas.hashtable.Int64HashTable.get_item (pandas\hashtable.c:7162)()</p>
    
    <p>KeyError: 28L</p>
  </blockquote>
  
  <p>What I want to do is</p>
  
  <pre><code>mlist = (b1,b2,b3,b4,b5)
  for q in mlist:
      for r in mlist:
          for i in range(len(q.index)):
              k = 0
              for j in range(len(r.index)):
                  if q['Date'][i] == r['Date'][j]:
                      k = k+1
                  else:
                      k = k
              if k == 1:
                  pass
              if k == 0:
                  q = q.drop([i])`enter code here`
  </code></pre>