This is how at() method works in the above case
np.add.at(x,i,1)
Here x will be array with all zeros as known,
Then i will be indexing to the array x, suppose you have given i = range(0,5), then this considers x[0],x[1],x[2],x[3],x[4].. so i is used to provide index for the array you need to change. i can be tuple also.
As you have given 1 as third attribute ,it adds one to the above indexes..
suppose your code was like this
import numpy as np
x = np.zeros(10)
i = range(0,5)
np.add.at(x, i, 1)
print(x)
output:
[1. 1. 1. 1. 1. 0. 0. 0. 0. 0.]
there fore adding one to all the indexes you have defined
#np.add.at(x, [0,2,3,4], 1) giving i as tuple is also fine
output for this will be as [1. 0. 1. 1. 1. 0. 0. 0. 0. 0.]