Thank you very much for the references you have given me: I have so much to “study” .
In the meantime I did some (almost) random experiments which do not necessarily have to do with the dataframe and tables packages …
I saw that:
Tables.columns(df.meta[1])
ERROR: to treat Dict{String, Any} as a table, it must have a key type of `Symbol`, and a value type `<: AbstractVector`
while:
Tables.columns([df.meta[1]])
Tables.CopiedColumns{NamedTuple{(:slots, :keys, :vals, :ndel, :count, :age, :idxfloor, :maxprobe), Tuple{Vector{Vector{UInt8}}, Vector{Vector{String}}, Vector{Vector{Any}}, Vector{Int64}, Vector{Int64}, Vector{UInt64}, Vector{Int64}, Vector{Int64}}}} with 1 rows, 8 columns, and schema:
:slots Vector{UInt8} (alias for Array{UInt8, 1})
:keys Vector{String} (alias for Array{String, 1})
:vals Vector{Any} (alias for Array{Any, 1})
:ndel Int64
:count Int64
:age UInt64
:idxfloor Int64
:maxprobe Int64
gives the result you showed before.
I tried using the getfield and propertynames functions on this dictionary df.data[1], getting this:
julia> propertynames(df.data[1])
(:slots, :keys, :vals, :ndel, :count, :age, :idxfloor, :maxprobe)
getfield(df.meta[1],7)
getfield(df.meta[1],2)
getfield(df.meta[1],3)
or
julia> df.meta[1].vals
16-element Vector{Any}:
"Daily Time Series with Splits and Dividend Events"
"2021-07-23"
#undef
#undef
#undef
#undef
"AAPL"
#undef
#undef
"Compact"
"US/Eastern"
#undef
#undef
#undef
#undef
#undef
Not knowing how things work behind the scenes, I thought these extra fields might depend on how the AlphaVantage.time_series_daily_adjusted function builds dictionaries.
To dispel the doubt I did a test with some dictionaries defined by me, getting similar result:
julia> vd=Dict{String, Any}("uno" => "1")
Dict{String, Any} with 1 entry:
"uno" => "1"
julia> propertynames(vd)
(:slots, :keys, :vals, :ndel, :count, :age, :idxfloor, :maxprobe)
julia> Tables.columns([vd])
Tables.CopiedColumns{NamedTuple{(:slots, :keys, :vals, :ndel, :count, :age, :idxfloor, :maxprobe), Tuple{Vector{Vector{UInt8}}, Vector{Vector{String}}, Vector{Vector{Any}}, Vector{Int64}, Vector{Int64}, Vector{UInt64}, Vector{Int64}, Vector{Int64}}}} with 1 rows, 8 columns, and schema:
:slots Vector{UInt8} (alias for Array{UInt8, 1})
:keys Vector{String} (alias for Array{String, 1})
:vals Vector{Any} (alias for Array{Any, 1})
:ndel Int64
:count Int64
:age UInt64
:idxfloor Int64
:maxprobe Int64
also when:
julia> vd=Dict{Symbol, Any}(:uno => "1")
Dict{Symbol, Any} with 1 entry:
:uno => "1"
julia> propertynames(vd)
(:slots, :keys, :vals, :ndel, :count, :age, :idxfloor, :maxprobe)
This means that, “internally” (some of you will understand better than me what this term means in this case :-), do dictionaries have a structure that uses meta-information in addition to keys and values?