Mercurial > hg > medcouple
diff pymedcouple @ 6:e3b1dcc51e6a
Fix tee usage
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Tue, 13 Jan 2015 17:26:39 -0500 |
parents | cbe17f888c79 |
children | 6c7c7dc9d8ef |
line wrap: on
line diff
--- a/pymedcouple +++ b/pymedcouple @@ -158,8 +158,9 @@ while Rtot - Ltot > n_plus: # First, compute the median inside the given bounds - I1 = (i for i in xrange(0, n_plus) if L[i] <= R[i]) - I2 = tee(I1) # Be stingy, reuse same generator + # (Be stingy, reuse same generator) + [I1, I2] = tee(i for i in xrange(0, n_plus) if L[i] <= R[i]) + A = [h_kern(i, (L[i] + R[i])//2) for i in I1] W = [R[i] - L[i] for i in I2] Am = wmedian(A,W)