Facebook
From Kadir Çallıoğlu, 1 Month ago, written in Python.
This paste is a reply to 6 from Kadir Çallıoğlu - view diff
Embed
Download Paste or View Raw
Hits: 175
  1. import pandas as pd
  2. import numpy as np
  3.  
  4. # Read the CSV file
  5. df = pd.read_csv('/Users/namnam/Downloads/country_vaccination_stats.csv')
  6.  
  7. # Calculate the median daily vaccination number per country
  8. median_vaccinations = df.groupby('country')['daily_vaccinations'].median()
  9.  
  10. top_3_countries = median_vaccinations.sort_values(ascending=False).head(3)
  11. print(top_3_countries)