import pandas as pd df_1 = pd.read_csv('items.csv') df_2 = pd.read_csv('signup.csv') df_3 = df_2.merge(df_1,left_on='item_id',right_on='item_id') df = df_3.groupby('item_name')['employee_id'].count() print(df[df != 0])