BUG: Regression in .loc accepting a boolean Index as an indexer by jreback · Pull Request #17738 · pandas-dev/pandas (original) (raw)

As I said, I agree the behaviour was kind of 'broken' (or at least strange) and good to fix, but still I wouldn't call this a regression fix (it has been like that for a long time). Although I can agree calling it a 'bug fix' for the integer case.

But for the boolean index case it is really a change in behaviour, because there the original behaviour made some sense:

In [58]: pd.__version__
Out[58]: '0.20.3'

In [59]: pd.Series([1, 2, 3], index=[False, True, False]).loc[pd.Index([True, False, True])]
Out[59]: 
True     2
False    1
False    3
True     2
dtype: int64
In [2]: pd.__version__
Out[2]: '0.21.0.dev+560.ga607872'

In [3]: pd.Series([1, 2, 3], index=[False, True, False]).loc[pd.Index([True, False, True])]
Out[3]: 
False    1
False    3
dtype: int64