Hello, I have an exciting problem. Consider type Block and rawData Matrix.
struct Block
name::String
data::Vector{Float64}
end
headers = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
rawData = rand(8700, 10)
dataRanges = Vector{UnitRange}([1:400, 500:8000])
Now we want to transform Matrix into Vector{Block} with using data ranges. My naive solution is:
function fNaive(rawData::Matrix{Float64}, dataRanges::Vector{UnitRange})
db = map(1:cols(rawData)) do i
map(r -> Block(headers[i], view(rawData, r, i)), dataRanges)
end
vcat(db...)
end
How to get the most effective solution for Vector{Block}, any solution?
Thanks
For better imagination, one block is a one-color of the Matrix.
