COVID-19 Tracking Data API and Data Anomalies (No Correlations? Cases to Hospitalizations Increases)

Is there a correlation between Positive cases and Hospitalizations? Below is the API for python access, open to all who desire to filter the data. I want to just give easy access to all the beginner students data scientists out there, such as myself..Explore and Discover: My Apologies It says High Def, but does not look High Def on video here

Code: import matplotlib.pyplot as plt import pandas as pd from scipy import stats import statsmodels.api as sm import requests import time from IPython.display import clear_output response = requests.get(“https://covidtracking.com/api/v1/us/daily.csv”) covid = response.content ccc = open(“daily.csv”,”wb”) ccc.write(covid) ccc.close() df = pd.read_csv(“daily.csv”, index_col = ‘date’) df.head() data = df[[‘positiveIncrease’,’hospitalizedIncrease’]] dataT = df[[‘positiveIncrease’,’hospitalizedIncrease’,’hospitalizedCurrently’]] dataD = df[[‘hospitalizedIncrease’,’deathIncrease’]] dataT.head(20) plt.figure(figsize=(20,10)) Y = data[‘positiveIncrease’] X = data[‘hospitalizedIncrease’] plt.scatter(X,Y) plt.ylabel(“Tested Positive Increase”) plt.xlabel(“Hospitalization Increase”) plt.show() Y1 = sm.add_constant(Y) reg = sm.OLS(X, Y1).fit() reg.summary() data.plot(y=[‘hospitalizedIncrease’,’positiveIncrease’],xticks=data.index[0:len(data):30], rot=90, figsize=(20,10) ) for x in range(len(data)): plt.figure(figsize=(20,10)) plt.xticks( data.index.values[0:len(data):30], rotation = 90, fontsize=20 ) plt.plot(data.tail(x))



Categories: Uncategorized

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: