Numpy: get the index of the elements of a 1d array as a 2d array
Pseudocode:

get the "number of 1d arrays in the 2d array", by subtracting the minimum value of your numpy array from the maximum value and then plus one. In your case, it will be 5-0+1 = 6
initialize a 2d array with the number of 1d arrays within it. In your case, initialize a 2d array with 6 1d array in it. Each 1d array corresponds to a unique element in your numpy array, for example, the first 1d array will correspond to '0', the second 1d array will correspond to '1',...
loop through your numpy array, put the index of the element into the right corresponding 1d array. In your case, the index of the first element in your numpy array will be put to the second 1d array, the index of the second element in your numpy array will be put to the third 1d array, ....

This pseudocode will take linear time to run as it depends on the length of your numpy array.
I have a numpy array like this: [1 2 2 0 0 1 3 5]
Is it possible to get the index of the elements as a 2d array? For instance the answer for the above input would be [[3 4], [0 5], [1 2], [6], [], [7]]
Currently I have to loop the different values and call numpy.where(input == i) for each value, which has terrible performance with a big enough input.