Cannot convert from DataValues.DataValue{Any} to DateTime
I'm trying to convert a row in an imported excel file into an array of DateTime allowing missing values.
using ExcelFiles, DataFrames
f_labs = "file.xlsx"
df = DataFrame(load(filename, "4!C1:X6"),header=false))
datetimearray = convert(Array{Union{Missings.Missing,DateTime}},df[2,:])
MethodError: Cannot `convert` an object of type DataValues.DataValue{Any} to an object of type DateTime
What's the correct way to do this?
This is a bug somewhere in my stack. The DataFrame you get there should never have a DataValue in it, it should automatically use Missing.
Note that Queryverse in general, and ExcelFiles in particular, are not completely ported to 0.7/1.0.
Ok. I ended up expanding on the wrong issue post then.
I'm sure it won't help you, but for anyone coming up against this needing help in the interim: https://github.com/queryverse/DataValues.jl/issues/47
Sometimes it shows cannot convert Any, would it be useful if it automatically call repr() on these?