Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created August 1, 2020 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnegi10/15601832eb3de12fd6757a430898d978 to your computer and use it in GitHub Desktop.
Save vnegi10/15601832eb3de12fd6757a430898d978 to your computer and use it in GitHub Desktop.
confirmed_cases = vec(convert(Array, last(y,1))) # convert last dataframe row into a 1-D array
recovered_cases = vec(convert(Array, last(y_r,1)))
deaths = vec(convert(Array, last(y_d,1)))
Y = Array{Float64,2}(undef, length(names(y_r)), 4) # 2-D array with number of confirmed, recovered and deaths
Y[:,1] = deaths
Y[:,2] = confirmed_cases
Y[:,3] = recovered_cases
Y[:,4] = Y[:,2] - (Y[:,3] + Y[:,1]) # number of currently infected = confirmed - (recovered + deaths)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment