import pandas as pd # Read data from a CSV file df = pd.read_csv('your_data.csv') # Replace 'your_data.csv' with your actual file path # Convert 'Date' column to datetime df['Date'] = pd.to_datetime(df['Date'], format='%m/%d/%Y') # Create a new DataFrame with minimum daily vaccinations for each country min_daily_vaccinations = df.groupby('Country')['daily_vaccinations'].min().reset_index() min_daily_vaccinations.columns = ['Country', 'Min_Daily_Vaccinations'] # Merge the original DataFrame with the minimum daily vaccinations DataFrame df = pd.merge(df, min_daily_vaccinations, on='Country', how='left') # Fill missing values in 'daily_vaccinations' with the minimum daily vaccinations df['daily_vaccinations'] = df['daily_vaccinations'].fillna(df['Min_Daily_Vaccinations']) # Fill remaining missing values with 0 df['daily_vaccinations'] = df['daily_vaccinations'].fillna(0) # Drop the 'Min_Daily_Vaccinations' column if you don't need it df = df.drop(columns=['Min_Daily_Vaccinations']) # Print the final DataFrame print(df)