Skip to content

Instantly share code, notes, and snippets.

@fk-pixel
Created August 17, 2020 13:07
Show Gist options
  • Save fk-pixel/81d4b976369027d64642e2a149c405d5 to your computer and use it in GitHub Desktop.
Save fk-pixel/81d4b976369027d64642e2a149c405d5 to your computer and use it in GitHub Desktop.
What are the top 5 venues/facilities nearby profitable real estate investments?
# What are the top 5 venues/facilities nearby profitable real estate investments?#
num_top_venues = 5
for hood in manchester_grouped['Street']:
print("----"+hood+"----")
temp = manchester_grouped[manchester_grouped['Street'] == hood].T.reset_index()
temp.columns = ['venue','freq']
temp = temp.iloc[1:]
temp['freq'] = temp['freq'].astype(float)
temp = temp.round({'freq': 2})
print(temp.sort_values('freq', ascending=False).reset_index(drop=True).head(num_top_venues))
print('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment