title: Pandas drop function: Unalignable boolean Series
body: <p>I have two DataFrames. The first df0:</p>
  
  <pre><code>Name       CHR  MAPINFO     PMG         APA 
  cg13869341  1   15865   0.8954256   0.8409144
  cg14008030  1   18827   0.5941512   0.712414
  cg12045430  1   29407   0.1110794   0.1302404
  cg20826792  1   29425   0.177532    0.1304049
  cg00381604  1   29435   0.09003246  0.04180672
  cg20253340  1   68849   0.4738799   0.444899
  </code></pre>
  
  <p>end the second df1:</p>
  
  <pre><code>probe   Chromosome  Gstart  Gend
  A_23_P11744     1   4363    39806
  A_33_P3365932   1   4363    39806
  A_32_P923011    1   24554   46081
  </code></pre>
  
  <p>I would like to iterate over df0["MAPINFO"] and drop rows that don't match condition and append the means to another df. My code is as followed:  </p>
  
  <pre><code>for pos in df0['MAPINFO']:
      cond = (( pos &lt; df1['Gstart']) &amp; ( pos &gt; df1['Gend']))
      print df0.drop(df0[cond].index.values).mean(axis=0, skipna=True, level=None)
  </code></pre>
  
  <p>which gives the following error message:</p>
  
  <pre><code>/usr/lib64/python2.7/site-packages/pandas-0.12.0-py2.7-linux-x86_64.egg/pandas/core/frame.py:2021: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
  "DataFrame index.", UserWarning)
  Traceback (most recent call last):
   File "/home/ferreirafm/bin/cpg_means.py", line 239, in &lt;module&gt;
  main()
  File "/home/ferreirafm/bin/cpg_means.py", line 231, in main
  import2df(infprobe, infchrom)
  File "/home/ferreirafm/bin/cpg_means.py", line 20, in import2df
  df0.drop(df0[cond].index.values)#.mean(axis=0, skipna=True, level=None)
  File "/usr/lib64/python2.7/site-packages/pandas-0.12.0-py2.7-linux-x86_64.egg/pandas/core/frame.py", line 1995, in __getitem__
  return self._getitem_array(key)
  File "/usr/lib64/python2.7/site-packages/pandas-0.12.0-py2.7-linux-x86_64.egg/pandas/core/frame.py", line 2027, in _getitem_array
  key = _check_bool_indexer(self.index, key)
  File "/usr/lib64/python2.7/site-packages/pandas-0.12.0-py2.7-linux-x86_64.egg/pandas/core/indexing.py", line 1017, in _check_bool_indexer
  raise IndexingError('Unalignable boolean Series key provided')
  pandas.core.indexing.IndexingError: Unalignable boolean Series key provided
  </code></pre>
  
  <p>I'm almost sure that such piece of code used to work in previous version of Pandas. However, I can't figure out whats going wrong.
  Any help is appreciated.</p>
  
  <p>Expected results:
  Observe that the last row of df0 is gonna be dropped as df1 'MAPINFO' of the first line (15865) is outside the df1 range Gstart and Gend. So, the results is gonna be the means by columns of the non-dropped lines from df0 (means of PGM and APA). That is, the resulting df will be:</p>
  
  <pre><code>Name       CHR  MAPINFO     PMG         APA 
  cg13869341  1   15865   0.8954256   0.8409144
  cg14008030  1   18827   0.5941512   0.712414
  cg12045430  1   29407   0.1110794   0.1302404
  cg20826792  1   29425   0.177532    0.1304049
  cg00381604  1   29435   0.09003246  0.04180672
  </code></pre>
  
  <p>The last row from df0 "cg20253340  1   68849   0.4738799   0.444899" is removed and the means by row is taken.</p>