Quantcast
Channel: Better way to create a Dataset? - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 3

Better way to create a Dataset?

$
0
0

I'd like to create a Dataset from an array, where each column's heading becomes the key for all elements in that column. I can accomplish this using nested Table commands, but was wondering if there is a more elegant way that directly leverages the syntax developed for Datasets. E.g., could this instead be accomplished using GroupBy?:

list = {{"date", "time", "volume"}, {a1, a2, a3}, {b1, b2, b3}, {c1,    c2, c3}}Table[<|Table[   list[[1, i]] -> list[[n, i]], {i, 1, Length@list[[1]]}]|>,    {n, 2, Length@list}]Dataset@%

enter image description here


Viewing all articles
Browse latest Browse all 3

Trending Articles