# COVID-19 Wolfram Data Repository Retrieval

I'm using this dataset to check out the data on new COVID-19 cases. But there are two issues:

1. Two days ago it was working great and it had data up to March 13; 1 day lag. Now when I run the cell in mathematica:

ResourceObject["Epidemic Data for Novel Coronavirus COVID-19"]


it doesn't update past March 13. So I cannot get the newer data by running the cell again.

2. On the data repo page it says it has data as recent as March 14. But I think the original data comes from Johns Hopkins University (link), which seems to have updated 14 hours ago (March 15).

So how can I 1. get the new data and, if I cannot expect the Wolfram data to update daily then 2. is it possible to import the JHU data directly and turn it into nice TimeSeries objects like they provide in the Wolfram data repo?

• I think they update it on weekdays only so by the end of Monday you will see it updated till 16th. But the patient data is so far off from its source and is missing several entries (docs.google.com/spreadsheets/d/…) – user13892 Mar 16 '20 at 16:18
• @user13892 I'm not sure that's the whole story because in the first link I posted, they have an example notebook that uses data from up to March 14. Mine only gets the data from March 13. – Diffycue Mar 16 '20 at 22:48
• I suspect you may need to use raw data from GitHub this may help "Coronavirus Covid 19 Stats Analysis in Excel" as it is not staightforward. youtube.com/watch?v=jgsSqDUbYqQ – deeuubee Apr 3 '20 at 10:58

It never updates for me properly. This is what I do:

ro = ResourceObject["Epidemic Data for Novel Coronavirus COVID-19"];
DeleteObject[ro];
ro = ResourceObject["Epidemic Data for Novel Coronavirus COVID-19"];


Wolfram basically just provides some minor convenience by re-formatting the data to a more Mathematica-compatible format. It may be a better idea to take the data from the source directly:

data = SemanticImport[
"https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv",
]

data[All, {1, 2, 5 ;;}][
All, {3 -> KeyMap[DateObject[{#, {"Month", "Day", "Year"}}, "Day"] &] /* TimeSeries}]

• Thanks this is exactly what I was looking for! – Diffycue Mar 17 '20 at 18:52
• @Szabolcs Thank you for your important and useful answer. Is it possible, that the link SemanticImport[…] is protected? I failed opening. – Ulrich Neumann Mar 27 '20 at 9:46
• @UlrichNeumann I was told they changed the structure of the data repo recently, please take a look on GitHub. I have not yet had a chance to look. – Szabolcs Mar 27 '20 at 9:58
• @Szabolcs Thanks, I'll try it – Ulrich Neumann Mar 27 '20 at 10:00

Use ResourceUpdate for this:

data = ResourceData[ResourceUpdate["Epidemic Data for Novel Coronavirus COVID-19"]];

• This is exactly what almost never works for me. It works if the data was last downloaded many days ago. But for updating every day, it does not work. – Szabolcs Mar 17 '20 at 19:08
• @Szabolcs Hm, worked for me today. If it doesn't, then it may be safely considered a bug, as it not doing what is supposed to according to documentation. – swish Mar 17 '20 at 19:11
• Did you update yesterday? Did you ever try using ResourceUpdate with a less than 24h difference from the last update? I already reported it to Wolfram and I was told that currently ResourceUpdate does not check for an update on the server. If the system has automatically synced with the server before, and therefore ResourceUpdate is aware that the data is out of date, then it will work. This was my understanding. – Szabolcs Mar 17 '20 at 19:34
• @Szabolcs Yeah, I've downloaded the data about two days ago for the first time, today I've decided to redraw my plot on a new data, this is what worked immediately, without doing any object deletion and without any troubles. – swish Mar 17 '20 at 19:38