Why not to use DataFrames functions? Reshaping · DataFrames.jl.
I’ve used this approach: Covid-19 julia reshape · GitHub