Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert from DataValues.DataValue{Any} to DateTime #13

Open
IanButterworth opened this issue Aug 11, 2018 · 3 comments
Open

Cannot convert from DataValues.DataValue{Any} to DateTime #13

IanButterworth opened this issue Aug 11, 2018 · 3 comments
Labels

Comments

@IanButterworth
Copy link

IanButterworth commented Aug 11, 2018

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?

@davidanthoff
Copy link
Member

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.

@IanButterworth
Copy link
Author

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:
queryverse/DataValues.jl#47

@xgdgsc
Copy link

xgdgsc commented Jan 27, 2019

Sometimes it shows cannot convert Any, would it be useful if it automatically call repr() on these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants