df[(df["Variable"]=="% Recycling") & (df["Country"]== ["United Kingdom", "Türkiye", "OECD - Total"])]
I could not understand why would this code give errors.
df[(df["Variable"]=="% Recycling") & (df["Country"]== ["United Kingdom", "Türkiye", "OECD - Total"])]
I could not understand why would this code give errors.
Try isin; you also need .loc:
df.loc[df["Variable"].eq("% Recycling")
& df["Country"].isin(["United Kingdom", "Türkiye", "OECD - Total"])]
or try with query:
df.query("Variable == '% Recycling' and Country in ['United Kingdom', 'Türkiye', 'OECD - Total']")