Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot convert Array{Any,2} to series data for plotting

Tags:

julia

I am learning the Julia from the coursera

using DelimitedFiles
EVDdata = DelimitedFiles.readdlm("wikipediaEVDdatesconverted.csv", ',')

# extract the data
epidays = EVDdata[:,1]
EVDcasesbycountry = EVDdata[:, [4, 6, 8]]

# load Plots and plot them
using Plots
gr()
plot(epidays, EVDcasesbycountry)

I am getting the error message Cannot convert Array{Any,2} to series data for plotting but in that course the lecturer successfully plots the data. where I am going wrong?

I search about the error where I end up something call parsing the string into an integer. As the data set may contain string values.

Or am I missing something else.

like image 808
Anil Sarode Avatar asked Jan 26 '23 00:01

Anil Sarode


1 Answers

I found this to be working for me:

# extract the data
epidays = Array{Integer}(EVDdata[:,1])
EVDcasesbycountry = Array{Integer}(EVDdata[:, [4, 6, 8]])

# load Plots and plot them
using Plots
gr()
plot(epidays, EVDcasesbycountry)
like image 57
Rene Avatar answered Feb 16 '23 18:02

Rene