Skip to content

Instantly share code, notes, and snippets.

@Perishleaf
Created December 15, 2019 21:45
Show Gist options
  • Save Perishleaf/9c8c7ba59a32c570c848d4c4feb04e6c to your computer and use it in GitHub Desktop.
Save Perishleaf/9c8c7ba59a32c570c848d4c4feb04e6c to your computer and use it in GitHub Desktop.
List the top 20 suburbs with the most number of venues
sydney_venues_num = sydney_venues.groupby('Suburb').count()
sydney_venues_num = sydney_venues_num.drop(columns=['Suburb Latitude', 'Suburb Longitude', 'Venue Latitude', 'Venue Longitude', 'Venue Category'])
sydney_venues_num = sydney_venues_num.sort_values(['Venue'], ascending=False).reset_index(drop=False)
sydney_venues_num['Suburb'] = sydney_venues_num['Suburb'].str.title()
print(sydney_venues_num.shape[0])
sydney_venues_num.head(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment