Is there a numpy manner to compute next problem? I really want to use numpy because the array is much much larger than this example.
a = np.array([[5, 2, 3, 4], [6, 3, 6, 6], [9, 1, 4, 6]])
b = np.min(a,1)
print(a)
# [[5 2 3 4]
# [6 3 6 6]
# [9 1 4 6]]
print(b)
# [2 3 1]
print(a-b) # ValueError: operands could not be broadcast together with shapes (3,4) (3,)
# What I want:
# [[3 0 1 2]
# [3 0 3 3]
# [8 0 3 5]]
keepdims=Truewithnp.min. Refer to docs.