image_output_3.png image_output_2.png image_output_1.png
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import seaborn as sns
state_data = '../input/State_time_series.csv'
df = pd.read_csv(state_data)
city_data = '../input/City_time_series.csv'
dfCity = pd.read_csv(city_data)
State_house = pd.read_csv('../input/State_time_series.csv', parse_dates=['Date'])
States = ['California', 'Colorado', 'Michigan']
newdf = df.loc[df['RegionName'].isin(States)]
newdf.Date = pd.to_datetime(newdf.Date)
newdf2 = newdf.loc[newdf['Date'].dt.year == 2016]
newdf3 = df.loc[df['RegionName'] == 'California']
newdf4 = df.loc[df['RegionName'] == 'Colorado']
newdf5 = df.loc[df['RegionName'] == 'Michigan']
newdf6 = dfCity.loc[dfCity['RegionName'] == 'san_franciscosan_franciscoca']
newdf6.Date = pd.to_datetime(newdf6.Date)
newdf7 = dfCity.loc[dfCity['RegionName'] == 'denverdenverco']
newdf7.Date = pd.to_datetime(newdf7.Date)
newdf8 = dfCity.loc[dfCity['RegionName'] == 'detroitwaynemi']
newdf8.Date = pd.to_datetime(newdf8.Date)