I have an n*m array "a", and another 1D array "b", such as the following:
a = array([[ 51, 30, 20, 10], [ 10, 32, 65, 77],