Breaking News

tempsnip

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

0 0

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()

About Post Author

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. 😉 Please feel free to e-mail: 161803p314159@gmail.com
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleppy
Sleppy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%
%d bloggers like this: