Selecting rows of DataFrame using Series of Boolean Mask

PHOTO EMBED

Fri Sep 23 2022 12:41:19 GMT+0000 (Coordinated Universal Time)

Saved by @hquizzagan #python

df = ...

mask = [True, False, True, True]

df[mask]

# Alternatively, you can use
df.loc[[mask]
content_copyCOPY

https://www.skytowner.com/explore/selecting_rows_based_on_a_condition_in_pandas