Analysis of the Corona Virus
Analysis of the Corona Virus
Seth J. Chandler 2020
Get the data from the Google Sheet
Get the data from the Google Sheet
In[]:=
sharingURL="https://docs.google.com/spreadsheets/d/1kUSYR3eqWHLzmWoxl69NrwEX_zwPf_GFM6_5DAiB-MI/edit?usp=sharing";
Now use StringReplace to replace the material after the final “/” with "export?format=csv".
In[]:=
urlCSV=StringReplace[sharingURL,"edit?usp=sharing"->"export?format=csv"]
Out[]=
https://docs.google.com/spreadsheets/d/1kUSYR3eqWHLzmWoxl69NrwEX_zwPf_GFM6_5DAiB-MI/export?format=csv
Change the URL to tell the Google Sheet to export itself as csv
And, now, I can import it as an CSV object. Note that we get both sheets of the spreadsheet.
In[]:=
corona=Import[urlCSV,"Dataset",HeaderLines1]
Out[]=
Convert the chronological information into Wolfram Language date objects
Convert the chronological information into Wolfram Language date objects
In[]:=
corona2=Query[All,Association["date"DateObject[{#Year,#Month,#Day}],#]&][corona]
Out[]=
Make some quick plots
Make some quick plots
In[]:=
Query[DateListPlot,{#date,#ChinaTotalCases}&][corona2]
Out[]=
In[]:=
Query[DateListPlot,{#date,#OutsideChinaTotalCases}&][corona2]
Out[]=
In[]:=
Query[DateListPlot,{#date,#ChinaSevereCases}&][corona2]
Out[]=
In[]:=
Query[DateListPlot,{#date,#ChinaTotalCases-#ChinaSevereCases}&][corona2]
Out[]=