I need to programmatically initialize an empty DataFrame using a vector of names and a vector of types:
Here is an example of doing this explicitly:
DataFrame(mystrings=String[],myints=Int64[])
0×2 DataFrame
MWE for doing this programmatically:
nm = ["mystrings","myints"]
tps = (String,Int64)
expr = :(DataFrame($nm .= $tps))
eval(expr)
ERROR: MethodError: Cannot `convert` an object of type Type{String} to an object of type String
3 posts - 2 participants