Would you suggest,
I have a list of columns (many of them). How to multiply all of them.
I know how to sum, but I have no idea, how to multiply
sum.(eachrow(qf[:,[:a,:b]]))
Thanks
Would you suggest,
I have a list of columns (many of them). How to multiply all of them.
I know how to sum, but I have no idea, how to multiply
sum.(eachrow(qf[:,[:a,:b]]))
Thanks
prod.(eachcol(df))
prod.(eachrow(df))
or
prod(Matrix(df), dims=1)
prod(Matrix(df), dims=2)
These work:
prod(Matrix(df), dims=1)
or if you want DataFrame
prod(Matrix(df), dims=1) |> x->DataFrame(x, names(df))
or
reduce((x, y)->Vector(x) .* Vector(y), eachrow(df)) |> x->DataFrame(x', names(df))
prod.(eachcol(df))
is very clever. Why can’t I think of that…
thanks. yes, it’s very clear. for some reasons, I tried mul. =))