How to filter dataframe rows with a boolean mask?

Hi,

I would like to the same thing as this python code:

import pandas as pd

array = [1,2,3]
df = pd.DataFrame(array)
mask = [True, False, True]
new_df = df[mask]
>>> print(new_df)
   0
0  1
2  3

Looked around, but didn’t find a short answer.

new_df = df[mask, :]
1 Like

Thanks !