Q5 - Onur Yigit Arpali

mail@pastecode.io avatar
unknown
python
3 years ago
436 B
5
Indexable
Never
#  _   _  ___ _____ _____ 
# | \ | |/ _ \_   _| ____|
# |  \| | | | || | |  _|  
# | |\  | |_| || | | |___ 
# |_| \_|\___/ |_| |_____|
#                         
# Assumed dataset file in same directory with the script
#

import pandas as pd

df = pd.read_csv('country_vaccination_stats.csv')

max3_med_daily_vacc = df.groupby('country').agg({'daily_vaccinations': 'median'}).nlargest(3,'daily_vaccinations')

print(max3_med_daily_vacc)