Shouldn't this work?
>>> pd.version.version
'0.13.0-472-g9109812'
>>> df = pd.DataFrame(np.random.random((10,4)))
>>> df = df.drop(df[0] > .5)
>>> df.drop(df[0] < .2)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-23-5df7f56de272> in <module>()
----> 1 df.drop(df[0] > .5)
/usr/local/lib/python2.7/dist-packages/pandas-0.13.0_472_g9109812-py2.7-linux-x86_64.egg/pandas/core/generic.pyc in drop(self, labels, axis, level, inplace, **kwargs)
1397 new_axis = axis.drop(labels, level=level)
1398 else:
-> 1399 new_axis = axis.drop(labels)
1400 dropped = self.reindex(**{axis_name: new_axis})
1401 try:
/usr/local/lib/python2.7/dist-packages/pandas-0.13.0_472_g9109812-py2.7-linux-x86_64.egg/pandas/core/index.pyc in drop(self, labels)
1621 mask = indexer == -1
1622 if mask.any():
-> 1623 raise ValueError('labels %s not contained in axis' % labels[mask])
1624 return self.delete(indexer)
1625
ValueError: labels [False False True True True True True False] not contained in axis
Comment From: jreback
AFAICT this is not supported, labels has to be a label of the axis; I think the first one 'happens' to work. That said I don't think this is hard to fix.
Comment From: jseabold
That's what I suspected. I was wondering if boolean for drop was supported given that I couldn't for the life of me reproduce the error. Then I realized it was on the second one and it had to do with the labels being different. Consider this a feature request then. Drop is nice and expressive. Would be nice if it supported boolean indexing.
Comment From: jreback
yep...its really just a front end to ix
...so pretty easy (it just needs to NOT convert a boolean indexer from labels)
Comment From: jreback
I believe #6599 should take care of this
Comment From: jreback
closing as dupe of #16877