I’m still new to Julia but there’s still some basics that I’m still clearly not understanding. Take the following example which has confused me all morning.
storage_indx_mult = hcat([12, 165, 55, 66, 89, 101, 2], [68, 135, 409, 222,6, 818,7])
column_index_mult = [1,1,2,2,1,1,2]
id_index = [6,4,5,2,1,7,3]
test_ids_mult = storage_indx_mult[id_index, column_index_mult]
In this case I’m expecting to get back a single vector:
test_ids_mult_expected = [101, 66, 6, 135, 12, 2, 409]
But Julia gives back a full matrix:
test_ids_mult = storage_indx_mult[id_index, column_index_mult]
7×7 Matrix{Int64}:
101 101 818 818 101 101 818
66 66 222 222 66 66 222
89 89 6 6 89 89 6
165 165 135 135 165 165 135
12 12 66 66 12 12 66
2 2 7 7 2 2 7
55 55 409 409 55 55 409
As I said, I’m clearly not understanding something about Julia and Indexing. I think coming from a python background is confusing my thinking. How do I extract the single vector I want from the two index vectors?