List of pairs

But this is exactly what I showed above, isn’t it? You can simplify your loop with a comprehension:

julia> A = [Tuple{Int64, Int64}[] for _ ∈ 1:10]
10-element Vector{Vector{Tuple{Int64, Int64}}}:
 []
 []
 []
 []
 []
 []
 []
 []
 []
 []

julia> push!(A[5], (2, 3))
1-element Vector{Tuple{Int64, Int64}}:
 (2, 3)

julia> A
10-element Vector{Vector{Tuple{Int64, Int64}}}:
 []
 []
 []
 []
 [(2, 3)]
 []
 []
 []
 []
 []
2 Likes