Tempsnip

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**

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)) print(dataT.tail(x)) plt.legend(dataT, fontsize=20) clear_output(wait=True) plt.show() print(dataT.tail(1)) plt.figure(figsize=(20,10)) plt.xticks( data.index.values[0:len(data):30], rotation = 90, fontsize=20 ) plt.plot(dataT.tail(x)) print(dataT.tail(x)) plt.legend(dataT, fontsize=20) plt.show() 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(dataD.tail(x)) print(dataD.tail(x)) plt.legend(dataD, fontsize=20) clear_output(wait=True) plt.show()

Ralph Turchiano

By Ralph Turchiano

I have a strong affinity for the sciences which led me to create my sites. My compulsion for the past decade has been reviewing literally every peer-reviewed research article. Which can easily be validated by following my posts. To me, science is where the real news is, as it will mold our destiny beyond that of politics or economics. ;-)

Leave a Reply

Discover more from CLINICALNEWS.ORG

Subscribe now to keep reading and get access to the full archive.

Continue reading