You have a pandas dataframe
import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/bprasad26/lwd/master/data/clothing_store_sales.csv') df.head()
And you want to select all the rows of data where the Method of Payment is Discover and MasterCard. You want to select rows from a pandas dataframe based on multiple values.
If you want to filter based on a single value, you can filter like this.
df[df['Method of Payment']=='Discover']
But to select rows based on multiple list of values you can use the isin method.
df[df['Method of Payment'].isin(['Discover','MasterCard'])]