I have written this piece of code:
w = Dist.argsort(kind='mergesort');
return y[w];
where w
is MxN matrix, and y
is Nx1 vector.
Everything works fine if shape returned by np.shape(y)
is (3,). However, when I try to input a vector of shape(3,1), my function returns a 3-dimensional MXNx1 matrix.
Is there a way to reduce (N,1) vector to (N,) size? Or to normalize output of the function for (N,1) vectors?