Filtering a Dataframe Using AND
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.
orders[(orders['PromoID'] == '30_OFF') & (orders['ProductID'] == 228722)]
By analyseup - Last Updated Jan. 12, 2022, 11:52 p.m.