Pandy Gropu przez
df1.groupby(["Name", "City"]).size().reset_index(name='count')
Condemned Cowfish
df1.groupby(["Name", "City"]).size().reset_index(name='count')