Table 2
Table 3
Thanks for your reply. I am not opposed to any method in particular,
I'm
just in the process of figuring out what is the best way to represent
the data in my application. The main issue is that some measurements
are scalars, while other measurements come with indices particular to
that measurement only.
T P D HC WN IR
run obs
1 1 298 1 997 4.18 1000 1.20
2 NaN NaN NaN NaN 1100 1.22
3 NaN NaN NaN NaN 1200 1.25
4 NaN NaN NaN NaN 1300 1.30
2 1 310 1 995 4.10 1000 1.21
2 NaN NaN NaN NaN 1100 1.22
3 NaN NaN NaN NaN 1200 1.25df.stack()
run obs 1 1 T 298.00 P 1.00 D 997.00 HC 4.18 WN 1000.00 IR 1.20 2 WN 1100.00 IR 1.22 3 WN 1200.00 IR 1.25 4 WN 1300.00 IR 1.30 2 1 T 310.00 P 1.00 D 995.00 HC 4.10 WN 1000.00 IR 1.21 2 WN 1100.00 IR 1.22 3 WN 1200.00 IR 1.25
You can then use the `xs` method of the dataframe to pull out values as needed.