temp1 = first_df.set_index(['fruit', 'rating'])
temp2 = second_df.set_index(['fruit', 'rating'])
result = temp1.add(temp2, fill_value=0)
Combining two pandas dataframes with just adding the integer count