Q4 - Onur Yigit Arpali

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

import pandas as pd

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

df['daily_vaccinations'].fillna(df.groupby('country')['daily_vaccinations'].transform('min'), inplace=True)

df['daily_vaccinations'].fillna(0, inplace=True)