I have an array that is as follows:
[[0, 0, 0, 1],
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
etc
I'd like to determine the sum of index [3] in each line.
For example, here I'd like to get 2
as a result.
I'm trying
np.sum(np.count_nonzero(array[:][3], axis=1))
but I get an out of bounds error. Any ideas?