import pandas as pd item = pd.read_csv("items.csv") signup = pd.read_csv('signup.csv') data = pd.merge(item,signup,on='item_id') a = data.groupby(by="item_name")['item_id'].apply('count') print(a)