text_plain_output_1.png
import numpy as np

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train_data = pd.read_csv('../input/covid19-global-forecasting-week-4/train.csv')
train_data = train_data.replace(np.nan, '', regex=True)
test_data = pd.read_csv('../input/covid19-global-forecasting-week-4/test.csv')
test_data = test_data.replace(np.nan, '', regex=True)

def filter_train_data(country, region):
    selector = train_data['Country_Region'] == country
    onlyonecountry = train_data[selector]
    selector2 = onlyonecountry['Province_State'] == region
    onlyoneregion = onlyonecountry[selector2]
    onlyoneregion = onlyoneregion.reset_index(drop=False)
    del onlyoneregion['index']
    del onlyoneregion['Id']
    onlyoneregion['Timestep'] = onlyoneregion.index
    return onlyoneregion

panama = filter_train_data('Panama', '')
panama.head()