I am, unsuccessfully, trying to create a density plot with CairoMakie based on a column of a dataframe.
using CairoMakie
CairoMakie.density(Rawdata.LVEDV)
MethodError: no method matching kde(::Vector{Any}; npoints=200)
When I ckeck the type of "Rawdata.LVEDV" the result is: Vector{Any} (alias for Array{Any, 1})
typeof(Rawdata.LVEDV) Vector{Any} (alias for Array{Any, 1})
Rawdata.LVEDV 309-element Vector{Any}:
first(Rawdata.LVEDV, 5)
147
161
160
104
127
What am I doing wrong? Apologies if this is too easy but I do not get it.
You seem to have mixed data types (e.g. float and strings). Look at the entire vector not just the first entries.
vs
Edit
If you really have only integers, I highly recommend you look at your code in more detail. Julia should not use Any for Int, as this will slow down Julia like crazy (no type inference will be possible anymore).
Just run
This should be a vector of Int64. You can run
unique(typeof.(df.test))to see the data types in your vector. In your case unique(typeof.(Rawdata.LVEDV)).