Counting indexes in pandas
I think maybe you are looking for:

receipts_by_name_x_cat = df.groupby(['name','category']).count()


Or, if you just want the total across all categories:

receipts_by_name = df.groupby(['name']).count()


Then, you can search those who have more than one:

receipts_by_name[receipts_by_name['receipt']&gt;1]


And, you can find the length of an index by typing:

len(df.index.get_level_values(0))


Assuming the name was the first index column (otherwise substitute 1, 2, etc.)