How to transform DataFrame back to its data source

This means you need to add the whole heavy DataFrames dependency to where you define Record.
A cleaner, more general, and no-deps approach is to define a kwargs constructor:

@kwdef struct Record 
   A::UInt32
   B::Float32
   C::Float32
end

Then,

[Record(; x...) for x in eachrow(df)]

works no matter the column order.

3 Likes