Update app.py
Browse files
app.py
CHANGED
@@ -127,7 +127,7 @@ def newman(wins: npt.NDArray[np.int64], ties: npt.NDArray[np.int64],
|
|
127 |
)
|
128 |
|
129 |
v = v_numerator / v_denominator
|
130 |
-
v = np.nan_to_num(v,
|
131 |
|
132 |
pi_old = pi.copy()
|
133 |
|
@@ -144,7 +144,7 @@ def newman(wins: npt.NDArray[np.int64], ties: npt.NDArray[np.int64],
|
|
144 |
)
|
145 |
|
146 |
pi = pi_numerator / pi_denominator
|
147 |
-
pi = np.nan_to_num(pi,
|
148 |
|
149 |
converged = np.allclose(pi / (pi + 1), pi_old / (pi_old + 1),
|
150 |
rtol=tolerance, atol=tolerance) or (iterations >= limit)
|
|
|
127 |
)
|
128 |
|
129 |
v = v_numerator / v_denominator
|
130 |
+
v = np.nan_to_num(v, nan=tolerance)
|
131 |
|
132 |
pi_old = pi.copy()
|
133 |
|
|
|
144 |
)
|
145 |
|
146 |
pi = pi_numerator / pi_denominator
|
147 |
+
pi = np.nan_to_num(pi, nan=tolerance)
|
148 |
|
149 |
converged = np.allclose(pi / (pi + 1), pi_old / (pi_old + 1),
|
150 |
rtol=tolerance, atol=tolerance) or (iterations >= limit)
|