I have a numpy matrix, and each row has a combination of positive and negative numbers.
I want to create a new vector, that gives me the average of all the positive numb
A possible solution would be
In code:
notneg = x >= 0 result = (x * notneg).sum(1) / notneg.sum(1)