So I have a DataFrame like this:
df = pd.DataFrame(np.random.randn(6, 3), columns=[\'a\', \'b\', \'c\']) a b c 0 1.877317 0.109646
You nearly had it:
In [11]: df[(df.a > 0) & (df.index.isin([0, 2, 4]))] Out[11]: a b c 0 1.877317 0.109646 1.634978 4 0.214583 -0.856150 -0.477844