Filtering a Dataframe Using AND
Python
In this code snippet we use "&" to include two conditions when filtering a Pandas dataframe.
Here we filter the orders dataframe where PromoID is "30_OFF" and the ProductID is 228722.
1| orders[(orders['PromoID'] == '30_OFF') & (orders['ProductID'] == 228722)]
147
131
125
118