print(df1.groupby(['Name', 'City'], as_index=False).count())
print(df1.groupby(['Name', 'City']).count())
print(df1.groupby(['Name', 'City'])[['Name', 'City']].count())
print(df1.groupby(['Name', 'City']).size().reset_index(name='count'))
Converting a Pandas GroupBy object to DataFrame