I have the following:
one = [0.3, 0.3, 0.3, 0.3, 0.3, 0.17, 0.255, 0.1, 0.145, 0.275, 0.17, 0.225, 0.25, 0.25, 0.28, 0.29, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]
two = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0]
data_needed = [one two] # build 22×2 Array{Float64,2}
For example output (truncated)
22×2 Array{Float64,2}:
0.3 0.5
0.3 1.0
0.3 1.5
0.3 2.0
0.3 2.5
0.17 3.0
0.255 3.5
0.1 4.0
0.145 4.5
0.275 5.0
So i wish to sort the full 22,2 array by the first column:
data_needed[1:size(data_needed,1)]
Float64[22]
0.300
0.300
0.300
0.300
0.300
0.170
0.255
0.100
0.145
0.275
0.170
0.225
0.250
0.250
0.280
0.290
0.300
0.300
0.300
0.300
0.300
0.300
Sort in ascending order:
Float64[22]
0.100
0.145
0.170
0.170
0.225
0.250
0.250
0.255
0.275
0.280
0.290
0.300
0.300
If sort by this first column in ascending order - it may associate the corresponding values in the second column to the same row position as the sorted column.
If i sorted a full data frame as e.g by a specific column, it would associate the other data on the same row to sorted order - does this happen for Arrays? using sort()
with no avail.