Re: SUM only of positive numbers from array

2016-01-08 Thread Davorin Bajic
On Friday, January 8, 2016 at 5:13:06 AM UTC+1, Davorin Bajic wrote: > Hi All, > > I should help... > > I want to calculate the sum of a positive number, for each row: > > > x = ((mat_1 / s_1T)-(s_2 / total)) > y = (np.sum(x > 0, axis=1)).reshape(-1, 1).tolist() > > However, this part of the c

Re: SUM only of positive numbers from array

2016-01-08 Thread Peter Otten
Davorin Bajic wrote: > Hi All, > > I should help... > > I want to calculate the sum of a positive number, for each row: > > > x = ((mat_1 / s_1T)-(s_2 / total)) > y = (np.sum(x > 0, axis=1)).reshape(-1, 1).tolist() > > However, this part of the code only calculation count, I need sum. > > An

SUM only of positive numbers from array

2016-01-07 Thread Davorin Bajic
Hi All, I should help... I want to calculate the sum of a positive number, for each row: x = ((mat_1 / s_1T)-(s_2 / total)) y = (np.sum(x > 0, axis=1)).reshape(-1, 1).tolist() However, this part of the code only calculation count, I need sum. Any ideas how to solve this problem? thanks in ad