In 11.0, all three methods work, the method suggested in the documents is to simply use df[mask] . However, this is done not by position, but exclusively using labels, therefore, in my opinion, loc best describes what actually happens.
Update: I asked github about this, the conclusion: df.iloc[msk] will give NotImplementedError (if the integer index is mask) or ValueError (if not the integer index) in pandas 11.1 .
In [1]: df = pd.DataFrame(range(5), list('ABCDE'), columns=['a']) In [2]: mask = (df.a%2 == 0) In [3]: mask Out[3]: A True B False C True D False E True Name: a, dtype: bool In [4]: df[mask] Out[4]: a A 0 C 2 E 4 In [5]: df.loc[mask] Out[5]: a A 0 C 2 E 4 In [6]: df.iloc[mask]
It may be worth noting that if you specified the integer index in oil, it would throw an error:
mask.index = range(5) df.iloc[mask]
This demonstrates that iloc is not actually implemented, it uses a label, so 11.1 will throw a NotImplementedError when we try this.
source share