Created
September 10, 2018 23:18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
team_medal_count = df.groupby(['Team','Medal']).Medal.agg('count') | |
# order them by quantity | |
team_medal_count = team_medal_count.reset_index(name='count').sort_values(['count'], ascending=False) | |
#team_medal_count.head(40) to show the first rows | |
def get_country_stats(country): | |
return team_medal_count[team_medal_count.Team==country] | |
# get_country_stats('some_country') to get that country's medals |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment