import pandas as pd Tk = pd.read_csv("Tk.csv", sep=",") Shop = pd.read_csv("Shop.csv", sep=",") df = pd.merge(Tk,Shop,on='ID',how='inner') print(df[df['Fans']>10000]['shop_name'])