How Transducers.jl process table?
get each column mean ?
using Transducers, Table, Statistics
N = 1_000_000
a = [2randn(N÷2) .+ 6; randn(N÷2)]
b = [3randn(N÷2); 2randn(N÷2)]
c = randn(N)
d = c .+ 0.6randn(N)
table = (; a, b, c, d); # NTuple{4, Vector{Float64}}}
# table_df = DataFrame(table)
row_data = Tables.rows(table)
aa = Transducers.foldl(right, row_data |> Map(mean) |> collect)
aa is a number such as 0.4
I want to get like this:
a b c d
0.3, 0.4, 0.5 0.6