Это можно решить с помощью DictReader из библиотеки "csv".
import csv
import collections
csv_file = open('olympics.csv', 'r', encoding='utf-8')
csv_input = csv.DictReader(csv_file)
country_medals_map = collections.defaultdict(int)
# initializes the country_medals_map with default value as int which will be 0.
# e.g test_dict = defaultdict(int), print(test_dict['not_set_key']) => 0
for input in csv_input:
country_medals_map[input['NOC']] += 1 if input['Medal'] in ['Gold', 'Silver', 'Bronze'] else 0
# set dict key as the rows country('NOC') value and increasing the dict value if medal present in GOLD SILVER or BRONZE.
# finally printing our dict formed.
for key, value in country_medals_map.items():
print(key, '-', value)
# output
# GRE - 10
# AUS - 5
# Uk - 20
Если вы хотите отсортировать вывод, а не сортировать (обновлять) его при создании, то сортируйте его позже.
sorted_by_medals = sorted(country_medals_map.items(), key=lambda kv: kv[1], reverse=True)
# printing our sorted output
for item in sorted_by_medals:
print(item)
# output
# ('Uk', 20)
# ('GRE', 10)
# ('AUS', 5)