text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import warnings

import matplotlib.pyplot as plt
plt.style.use('dark_background')
import warnings
warnings.filterwarnings('ignore')
import seaborn

train_data = pd.read_csv('/kaggle/input/covid19-global-forecasting-week-4/train.csv')
test_data = pd.read_csv('/kaggle/input/covid19-global-forecasting-week-4/test.csv')

train_data.rename(columns={'Country_Region': 'Country'}, inplace=True)
test_data.rename(columns={'Country_Region': 'Country'}, inplace=True)
train_data.rename(columns={'Province_State': 'Province'}, inplace=True)
test_data.rename(columns={'Province_State': 'Province'}, inplace=True)

india = train_data.loc[train_data['Country'] == 'India']
plt.xticks(rotation=90)

confirmed = train_data.groupby('Date').sum()['ConfirmedCases'].reset_index()
deaths = train_data.groupby('Date').sum()['Fatalities'].reset_index()
plt.xticks(rotation=90)

train_data['Date'] = pd.to_datetime(train_data['Date'])
test_data['Date'] = pd.to_datetime(test_data['Date'])

train_data['Province'] = train_data.apply(lambda row: str(row['Country']) if pd.isnull(row['Province']) else row['Province'], axis=1)
test_data['Province'] = test_data.apply(lambda row: str(row['Country']) if pd.isnull(row['Province']) else row['Province'], axis=1)

train_data.drop(['Id'], axis=1, inplace=True)

train_data.head()