Filtering a Dataframe Using OR
Python
In this code snippet we filter to the order dataframe so that it only includes rows where either PromoID is "30_OFF" or ProductID is 228722. We do this using "|" which represent the OR operator.
1| orders[(orders['PromoID'] == '30_OFF') | (orders['ProductID'] == 228722)]
150
133
128
120