I want to create a new dataframe from an existing one (kinda slicing) which will contain those rows which satisfy the condition among multiple columns. Currently I write each columns names separately in the query
df1=df[(df.Q25_1 == 'Earpods') & (df.Q25_2 == "Earpods") & (df.Q25_3 == "Earpods") ......... & (df.Q25_20 == "Earpods")]
Is there a easier way to compare them like slicing techniques eg.
You can use