Another method:
p = sortperm(eachrow(T1); by=r->(r[1], r[2], -r[12]))
T1 = T1[p, :]
B = B[p, :]
(didn’t really test this, but it should work)
Another method:
p = sortperm(eachrow(T1); by=r->(r[1], r[2], -r[12]))
T1 = T1[p, :]
B = B[p, :]
(didn’t really test this, but it should work)