# Loading COVID-19 CSV data

**URL:** <https://discourse.julialang.org/t/loading-covid-19-csv-data/35820>\
**Category:** Data\
**Created:** [March 11, 2020, 3:34am UTC](https://discourse.julialang.org/t/loading-covid-19-csv-data/35820 "2020-03-11T03:34:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/glen/32/3583_2.png) [@Glen](https://discourse.julialang.org/u/Glen)\
**Post date:** [March 11, 2020, 3:34am UTC](https://discourse.julialang.org/t/loading-covid-19-csv-data/35820/1 "2020-03-11T03:34:24Z")

</div>

Hi Julians,

I am trying to read the latest COVID-19 data to do analysis, from here:

[https://github.com/CSSEGISandData/COVID-19/blob/master/csse\_covid\_19\_data/csse\_covid\_19\_time\_series/time\_series\_19-covid-Confirmed.csv](https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv)

Using CSV or CSVFiles the data doesn’t load in correctly. The 5th column (and higher) are filled with many `missing` values yet the dataset uses `0` for the numeric columns (not missing).

```julia
using DataFrames, CSV, Dates
function read_data()
    data = Dict{Symbol,DataFrame}()
    for t in [:Confirmed, :Deaths, :Recovered]
        p = "./data/archived_data/archived_time_series/time_series_2019-ncov-$t.csv"
        data[t] = CSV.read(p, copycols=true, dateformat="m/dd/yy")
        #data[t] = DataFrame(load(p))
    end
    return data
end

```

I’m using Jula v1.3.1 and the current stable versions of CSV (and CSVFiles). Any idea what is the issue?

Thanks,

Glen

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [March 11, 2020, 3:58am UTC](https://discourse.julialang.org/t/loading-covid-19-csv-data/35820/2 "2020-03-11T03:58:16Z")

</div>

I can’t replicate that with [CSVFiles.jl](https://github.com/queryverse/CSVFiles.jl). When I use this code to load the data:

```julia
using CSVFiles, DataFrames

df = load("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv") |> DataFrame

```

I don’t get any missing values in at least the first 19 columns (I haven’t looked at the other ones).

This is with CSVFiles 0.16.1 and DataFrames 0.20.2.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [March 11, 2020, 4:17am UTC](https://discourse.julialang.org/t/loading-covid-19-csv-data/35820/3 "2020-03-11T04:17:16Z")

</div>

this is what I do

```julia
open("time_series_confirmed.csv", "w") do fio
    write(fio, HTTP.request("GET", "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv").body |> String)
end
dfc = CSV.File("time_series_confirmed.csv") |> DataFrame
rename!(dfc, Dict(Symbol("Country/Region") => :Country, Symbol("Province/State") => :State));

```
