标签云

微信群

扫码加入我们

WeChat QR Code

Suppose we have a Vector of tuples (Int64, Int64) in julia:In [1] xx = [(1, 2), (3, 4), (5, 6)] typeof(xx) == Vector{(Int64, Int64)}Out[1] trueNow I want to construct a new vector of the first indices of the tuples. In [2] indices = [x[1] for x in xx] typeof(indices)Out[2] Array{Any, 1}I expect it to be an Array{Int64, 1} type. How can I fix this?edit: I am using 0.3.9.


Thanks Colin. Got it.

2019年04月20日50分00秒