I am having difficulties combining operations with Queries on hierarchical data sets.
Here is a contrived example hierarchical dataset:
dset = (Query[GroupBy["integer"]]@
Dataset[AssociationThread[{"color", "integer", "vector1",
"vector2"} :>
#] & /@
Table[{RandomColor[], Mod[i, 3], RandomReal[{-1, 1}],
RandomReal[{-1, 1}]}, {i, 12}]])[All,
All, {"color", "vector1", "vector2"}]
I'd like to compute the dot product of the vectors of length 4 in "vector1" and "vector2" column for each of the grouped rows.
I can do this easily by turning the dataset into a Normal expression, but I am trying to learn how to do it with Dataset and Query