Let's say, You want to reshape your NumPy array with 10*2 dimension to 5*4. You need:
a = np.zeros((10, 2)) # Generates 10*2 zero matrix
np.reshape(a, newshape=(5, 4))
This gives output like this:
array([[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 0.],
[0., 0., 0., 0.]])
The same output can be produced by:
np.reshape(a, newshape=(5, -1))
Because the value for second dimension is inferred from the length of the array and remaining dimensions. Here it will take 4, but if you want 2*10 array then you can use newshape=(2,-1) here second value will be 10.