This is reasonably clean:
[y[i] for y in x, i in 1:3]
If performance matters you are probably better off with the other
suggestions.
Den måndag 6 juli 2015 kl. 22:10:01 UTC+2 skrev Júlio Hoffimann:
>
> Hi,
>
> How to convert:
>
> 1000-element Array{Tuple{Integer,Integer,Integer},1}:
> (10,2,1)
> (5,7,10)
> (5,7,4)
> (1,1,6)
> (2,3,6)
> (8,6,4)
> (10,2,4)
> (1,3,9)
> (9,3,7)
> (5,2,4)
> ⋮
> (1,6,8)
> (4,6,6)
> (3,9,5)
> (10,4,10)
> (8,7,4)
> (4,8,9)
> (2,6,10)
> (3,6,5)
> (1,7,10)
>
> into the corresponding 1000x3 matrix in a "clean fashion"?
>
> -Júlio
>