I'm using python 3.9/numpy 1.22.
Suppose I have a 3x3 matrix:
x = np.array([[10,40,0],[0,40,90],[10,0,90]]).All elements are integers > 0.Every row has exactly 2 non-zero integers.
I would like to produce the 3x2 matrix y such that
y = np.array([[10,40],[40,90],[10,90]])I feel close when using numpy.apply_along_axis(), numpy.squeeze(), and/or numpy.where() but I'm missing something.