I know there has to be a clever way to do this in Julia but I'm stumped. I 
have a 1d array of tuples and I want to extract the third element from each 
row of the array. Here is an example of what I'm working with:

julia> experArr 20-element Array{(Any,Any,Any),1}:
 (4000,0.97613,1.6e6) 
 (2000,0.97613,800000.0)
 (8000,0.97613,3.2e6) 
 (1000,0.97613,400000.0)
 ...



My first thought was to do something like this:


julia> experArr[:][3]
 
but that returns the following:


julia> experArr[:][3] 
(8000,0.97613,3.2e6)


What I want it to return is this:


20-element Array{Any,1}:1.6e6
800000.0
3.2e6
400000.0
...


I have tried several other permutations of indexing but I keep only returning a 
single element. I feel that there is a right way to do this and I'm just 
missing it. Thanks for the help!

Reply via email to