Can anyone exmplain me how this type of indexing is work with numpy arrays?
n=10
l=[0,1,1,1,1,0,0,1,0,1]
array=np.zeros((n,2))
array[np.arange(n),l] = k
I know what is the result. But I want to know how the last line of code operates(explanation)?