For example:
a = np.array([[ 0, 1, 1], [2, 4, 2]])
I would like for each row in array 'a' to be divided by the last element in each row so the output is as below.
array([[0, 1, 1],
[1, 2, 1]])
I would like to apply this to a much larger array but with the same operation. I am currently doing this using for loops that take too long and can't find an equivalent function.