udibehar
(Ehud Behar)
January 10, 2024, 5:16pm
1
I have the following two datasets:
Dataset[{
<|"Date" -> DateObject[{2024, 1, 10}]|>,
<|"Collection-area" -> Quantity[3, ("Centimeters")^2]|>,
<|"Integration Time" -> Quantity[2.1, "Seconds"]|>
}]
and
Dataset[{
<|"\[Lambda]" -> Quantity[195.050, "Nanometers"], "r" -> Quantity[2.9, "Watts"]|>,
<|"\[Lambda]" -> Quantity[196.000, "Nanometers"], "r" -> Quantity[2.1, "Watts"]|>,
<|"\[Lambda]" -> Quantity[196.050, "Nanometers"], "r" -> Quantity[2.6, "Watts"]|>
}]
How can I merge them into a new dataset that looks the following:
eric3
(Eric Rimbey)
January 11, 2024, 5:02pm
2
For your expected dataset, did you use actual code to create that, or is it just a graphic or some other “fake”. If I could see the actual structure of that dataset, it would be easier. But anyway, in the meantime, this is close:
d1 = Dataset[{<|"Date" -> DateObject[{2024, 1, 10}]|>,
<|"Collection-area" -> Quantity[3, ("Centimeters")^2]|>,
<|"Integration Time" -> Quantity[2.1, "Seconds"]|>}];
d2 = Dataset[{<|"\[Lambda]" -> Quantity[195.050, "Nanometers"], "r" -> Quantity[2.9, "Watts"]|>,
<|"\[Lambda]" -> Quantity[196.000, "Nanometers"], "r" -> Quantity[2.1, "Watts"]|>,
<|"\[Lambda]" -> Quantity[196.050, "Nanometers"], "r" -> Quantity[2.6, "Watts"]|>}];
Dataset[Append[d1, Merge[d2, Dataset]]]
udibehar
(Ehud Behar)
January 11, 2024, 5:09pm
3
It is faked, with Microsoft Paint :Facepalming:
cverdon
(Carl Verdon)
February 10, 2024, 10:30pm
4
To approximate the look you want, is this good enough?
Column[{d1, d2}, Alignment -> Center, Spacings -> 1, Frame -> True,
FrameStyle -> Gray]
Out[] =
Otherwise, you can alternatively do this:
Dataset[{
<|"Date" -> DateObject[{2024, 1, 10}]|>,
<|"Collection-area" -> Quantity[3, ("Centimeters")^2]|>,
<|"Integration Time" -> Quantity[2.1, "Seconds"]|>,
<|"\[Lambda],r" -> d2
}]