Yes you understood correctly. Thank you for your answer, i wasn’t aware of this DataFrame constructor. I was wondering if this approach however could be made more efficient, given that it creates a new NamedTuple for each data entry. But on the other hand, i guess the compiler can optimize this away?
Yes that’s right, the compiler will optimize away the NamedTuple construction, although now that you mention it, it wont optimize away the splitting of the array into an array of Time and an array of Measure properties, so from that point of view, @JonasWickman’s suggestion is likely more efficient.
@JonasWickman probably your solution is the most efficient, but I think keeping it row first helps readability given that I want to check these data from time to time, anyway I’ll keep that in mind, thanks.
Didn’t realized this either, thanks! I guess it’s a matter of wether to keep the schema in the tuples (more robust if you accidentally invert some data), or as an external parameter (that you can share among different DataFrames to make sure they all have a consistent interface). Actually I would have expected to be a constructor that accepts the header name first, and then the data, given that is the order in which you normally see it listed. Possibly i can think of a macro to do provide names, types and data all at once, since i use this style quite a lot