### Week4- individual HW
# In that script or notebook. Write a Python function that behaves as follows:
# 1.It takes as input the abbreviation of a state in the U. S., such as "MA"or "TX".
# 2.It returns as output a pandas Series of the number of confirmed cases of COVID-19
# in that state over time.
import numpy as np
import pandas as pd
#import cases file
df_case = pd.read_csv('covid_confirmed_usafacts.csv')
df_case.head()
#import population file
df_pop = pd.read_csv('covid_county_population_usafacts.csv')
df_pop.head()
#input a abbreviation of a state in the US
x = input("Abbreviation of a State: ")
#merge info from two dataframes by column State
df = df_case.merge(df_pop, on =['State'])
#extract population info by input
df2= df.loc[df['State'] == x, 'population']
#show the population info
df2.head()