Hi there
I’m looking for an example I can examine that loads a nested dict into a data table. I can’t seem to find any. I see many for dataframes but none for dict like this one.
ata_flow =
Dict{String, Any}("AMZN" => Dict{String, Any}("hv10" => "45.99", "price" => "122.16", "iv_%" => "83.4", "hv20" => "52.14", "iv" => "40.64", "hv5" => "41.21", "prc_%" => "7.51"), "VZ" => Dict{String, Any}("hv10" => "13.87", "price" => "51.27", "iv_%" => "65.61", "hv20" => "12.71", "iv" => "17.62", "hv5" => "10.32", "prc_%" => "19.37"), "C" => Dict{String, Any}("hv10" => "21.26", "price" => "51.78", "iv_%" => "72.73", "hv20" => "42.75", "iv" => "31.75", "hv5" => "20.79", "prc_%" => "11.86"), "IEX" => Dict{String, Any}("hv10" => "19.16", "price" => "195.55", "iv_%" => "70.36", "hv20" => "24.97", "iv" => "27.62", "hv5" => "18.77"))
I want to end up with a dash table like this one
HV_10 PRICE IV_% hv20 iv hv5 prc_%
AMZN 45.99 122.16 83.4 52.14 40.64 41.21 7.51
VZ 13.87 51.27 65.61 12.71 17.62 10.32 19.37
C 21.26 51.78 72.73 42.75 31.75 20.79 11.86
IEX 19.16 195.55 70.36 24.97 27.62 18.77
thanks to a great deal of help from the community I have the columns
columns=[Dict("name" =>i,"id" => i) for i in collect(keys(first(values(data_flow))))]
but the data load has me stumped.
if I try
data = Dict.(pairs.(Values) )
I don’t get the row entries ie “AMZN” but I get the values in the right place. I’m almost there but I can’t figure out how to “insert” the key from the Dict for the values.
here is where I am at right now.
app.layout = dash_datatable(
id="table",
columns=[Dict("name" =>i,"id" => i) for i in collect(keys(first(values(data_flow))))],
data = Dict.(pairs.(Values) )
)