I have 3 arrays of
a = np.array([[1], [4], [5], [11], [10]])
b = np.array([[14], [3], [2], [13], [12]])
c = np.array([[6], [23], [24], [8], [9]])
I have merged these arrays and sorted them as folow:
new = np.sort(np.concatenate([a, b, c], axis=1))
which results in:
[[ 1 6 14]
[ 3 4 23]
[ 2 5 24]
[ 8 11 13]
[ 9 10 12]]
Now I am looking for a way to show from what initial array (a,b,c), each value is picked. for example, I want to get
[[ 'a' , 'c' , 'b']
[ 'b' , 'a' , 'c']
[ 'b' , 'a' , 'c']
[ 'c' , 'a' , 'b']
[ 'c' , 'a' , 'b']]
I am not sure if I am in the right way or should I use dictionaries for this purpose?
question from:
https://stackoverflow.com/questions/65670795/how-to-show-the-initial-array-after-concatenating-and-sorting 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…