Suppose I have the following dataset:
dataset = Dataset[{{195, 2.3}, {198, 6.4}, {204, -3.1}}]
How can I add a header x
to the first column and a header y
to the second column, so to get the following new dataset:?
Dataset[{
<|"x" -> 195, "y" -> 2.3|>,
<|"x" -> 198, "y" -> 6.4|>,
<|"x" -> 204, "y" -> -3.1|>
}]
I am also looking for a command to assing units (cm and volts) to the values, so to get the following:
Dataset[{
<|"x" -> Quantity[195, "Centimeters"], "y" -> Quantity[2.3, "Volts"]|>,
<|"x" -> Quantity[198, "Centimeters"], "y" -> Quantity[6.4, "Volts"]|>,
<|"x" -> Quantity[204, "Centimeters"], "y" -> Quantity[-3.1, "Volts"]|>
}]
Any ideas?