Facebook
From Kadir Çallıoğlu, 1 Month ago, written in Python.
Embed
Download Paste or View Raw
Hits: 151
  1. import pandas as pd
  2.  
  3. # Read the CSV file
  4. df = pd.read_csv('/Users/namnam/Downloads/country_vaccination_stats.csv')
  5.  
  6. df['daily_vaccinations'] = df['daily_vaccinations'].fillna(0)
  7. df['date'] = pd.to_datetime(df['date'], format='%m/%d/%Y')
  8.  
  9. df_on_date = df[df['date'] == '2021-01-06']
  10.  
  11. total_vaccinations = df_on_date['daily_vaccinations'].sum()
  12.  
  13. print('Total vaccinations on 1/6/2021:', total_vaccinations)