# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1421187999 18000 # Node ID e3b1dcc51e6a74de7f2b28bced3108cec1e7f3c0 # Parent cbe17f888c79e5122e1b6da5c6f53b7b5df87a11 Fix tee usage diff --git a/pymedcouple b/pymedcouple --- 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)