Skip to content

Instantly share code, notes, and snippets.

@vanessaaleung
Last active September 28, 2019 17:56
Show Gist options
  • Save vanessaaleung/264e899cb9241bd3d009ccbe0b29d4cb to your computer and use it in GitHub Desktop.
Save vanessaaleung/264e899cb9241bd3d009ccbe0b29d4cb to your computer and use it in GitHub Desktop.
def return_most_common_venues(row, num_top_venues):
row_categories = row.iloc[1:]
row_categories_sorted = row_categories.sort_values(ascending = False)
return row_categories_sorted.index.values[0:num_top_venues]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment