1

I'm trying to increment values in a numpy array multiple times. For example I would like to do:

input = np.array([[1,1],[2,2]])
input[[0,0,0],[1,0,1]] += [4,1,6]

and get output:

array([[2, 11], [2, 2]])

However, numpy gives

array([[2, 7], [2, 2]])

Is there a way to increment the same index multiple times?

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.