It should be a standard question but I am not able find the answer :(
I have a numpy darray n samples (raw) and p variables (observation). I would like to count how many times each variables is non 0.
I would use a function like
sum([1 for i in column if i!=0])
but how can I apply this function to all the columns of my matrix?