diff pymedcouple @ 11:4c7d7ff28a0e

Rename mid_idx to medc_idx
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 16 Jan 2015 09:24:40 -0500
parents 3d145bcc8694
children c81f6d263897
line wrap: on
line diff
--- a/pymedcouple
+++ b/pymedcouple
@@ -153,7 +153,7 @@
 
     Ltot = 0
     Rtot = n_minus*n_plus
-    mid_idx = (Rtot-1)//2
+    medc_idx = (Rtot-1)//2
 
     # kth pair algorithm (Johnson & Mizoguchi)
     while Rtot - Ltot > n_plus:
@@ -191,12 +191,12 @@
         # the whole matrix may be.
         sumP = sum(P) + len(P)
         sumQ = sum(Q)
-        
-        if mid_idx <= sumP - 1:
+
+        if medc_idx <= sumP - 1:
             R = P
             Rtot = sumP
         else:
-            if mid_idx > sumQ - 1:
+            if medc_idx > sumQ - 1:
                 L = Q
                 Ltot = sumQ
             else:
@@ -212,7 +212,8 @@
     A.sort()
     A.reverse()
 
-    Am =  A[mid_idx - Ltot]
+    Am =  A[medc_idx - Ltot]
+
     return Am