When colwise generate a couple of arrays instead of one array with many elements

Hi guys,

cf = colwise(mean, test) #test is a two columns data frame
I got:
dump(cf)
Array{Any}((2,))
1: Array{Float64}((1,)) [0.056307]
2: Array{Float64}((1,)) [0.0330923]

So I have to use [float(cf[i][1]) for i in 1:size(cf)[1]] to get this:
2-element Array{Float64,1}:
0.056307
0.0330923

Is there an easy way to get Array{Float64,1} instead of Array{Any}((2,))?

Thanks,

Hongwei

Just find squeeze(mean(Array(test), 1), 1) could do the same thing.

Yes, that’s a known issue. For now your solution is the best workaround.

1 Like