Entering edit mode
11.5 years ago
cutin
▴
10
Dear all,
I have an array, namely A, (m rows and n columns), I would like to calculate "sum of a column if criteria in other columns"
Example: sum of the 2nd column and criteria in the first column
In R:
sum(A[A[, 1] < h, 2])
How I can do it in python without loops?
Thanks,