I have this large 1d NumPy array that has the values between [0, 6]. For example, suppose A = [0, 0, 2, 4, 4]
I want to create a array using A: B = [2, 0, 1, 0, 2, 0, 0]
This is because there are 2 0s in the A, 0 1s in A, 1 2s in A, 0 3s in A, 2 4s in A, 0 5s in A, 0 6s in A.
Kindly suggests to me an efficient method is to do this.