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