Skip to content

Pandas

Pandas tips and tricks.

Filter dataframe with multiple conditions

df = <some-dataframe>

df_with_conditions = df[(<condition1>) & (<condition2>)]
For example
df_example = df[(df.col1 == "hello") & (df.col2 == "world")]