The code below (and attached) creates a hierarchical dataset in which the top-level keys map to a list of associations. The intent is to be able to perform an efficient structured access to data. But my attempts to access the data result in errors. What am I doing wrong?
ri := RandomInteger[{1, 9}]
record := <|"a" -> ri, "b" -> ri, "c" -> ri|>
group[n_] := <|"k" <> n -> Table[record, {4}]|>
ds = Dataset[group /@ {"1", "2", "3"}]
In[6]:= ds[["k1"]]
Out[6]= Failure[Dataset,
Association[
"MessageTemplate" :> MessageName[Dataset, "partnotapplicable"],
"MessageParameters" -> Association["Type" -> TypeSystem`Vector[
TypeSystem`Assoc[
TypeSystem`Atom[String],
TypeSystem`Vector[
TypeSystem`Struct[{"a", "b", "c"}, {
TypeSystem`Atom[Integer],
TypeSystem`Atom[Integer],
TypeSystem`Atom[Integer]}], 4], 1], 3], "Part" -> "k1",
"Symbol" -> Part]]]
Attachments: