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

**URL:** https://discourse.julialang.org/t/when-colwise-generate-a-couple-of-arrays-instead-of-one-array-with-many-elements/663
**Category:** Data
**Tags:** question
**Created:** [November 30, 2016, 11:59pm UTC](https://discourse.julialang.org/t/when-colwise-generate-a-couple-of-arrays-instead-of-one-array-with-many-elements/663 "2016-11-30T23:59:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hongwei](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hongwei/32/264_2.png) [@Hongwei](https://discourse.julialang.org/u/Hongwei)
#### Post date: [November 30, 2016, 11:59pm UTC](https://discourse.julialang.org/t/when-colwise-generate-a-couple-of-arrays-instead-of-one-array-with-many-elements/663/1 "2016-11-30T23:59:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Hongwei](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hongwei/32/264_2.png) [@Hongwei](https://discourse.julialang.org/u/Hongwei)
#### Post date: [December 1, 2016, 3:10am UTC](https://discourse.julialang.org/t/when-colwise-generate-a-couple-of-arrays-instead-of-one-array-with-many-elements/663/2 "2016-12-01T03:10:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [December 2, 2016, 2:19pm UTC](https://discourse.julialang.org/t/when-colwise-generate-a-couple-of-arrays-instead-of-one-array-with-many-elements/663/3 "2016-12-02T14:19:53Z")

</div>

Yes, that’s [a known issue](https://github.com/JuliaStats/DataFrames.jl/issues/485). For now your solution is the best workaround.
