filter dataframe by two columns
#tl;dr use the '&' opperator and not the word 'and'
print(df)
OUTPUT
Name Age
0 Joe 23
1 Tom 54
2 Joe 34
3 Tom 42
4 Joe 23
5 Tom 54
6 Joe 34
7 Tom 42
tom_and_42 = df[(df["Name"]=="Tom") & (df["Age"]==42)]
print(tom_and_42)
OUTPUT
Name Age
3 Tom 42
7 Tom 42