# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1421542567 18000 # Node ID f5b4a2ab6204766af4a231d6b68c1e88e3e6c753 # Parent d63e763f8ac1d17236b2fa90d1224d5d910cba9a medcouple_1d: modify the definition of medc_idx to match R's definition This uses the right (not left) middle in case of an even number of things and the middle one in case of an odd number. diff --git a/pymedcouple b/pymedcouple --- a/pymedcouple +++ b/pymedcouple @@ -153,7 +153,7 @@ Ltot = 0 Rtot = n_minus*n_plus - medc_idx = (Rtot - 1)//2 + medc_idx = Rtot//2 # kth pair algorithm (Johnson & Mizoguchi) while Rtot - Ltot > n_plus: