Skip to content

Commit f32e468

Browse files
committed
Remove python27 support for xrange due to migration to python3.5+
1 parent 2d3aa9a commit f32e468

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

quantecon/markov/gth_solve.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
import numpy as np
1111
from numba import jit
1212

13-
#-TODO: Remove as we no longer support Python <3.5?
14-
try:
15-
xrange
16-
except: # python3
17-
xrange = range
18-
19-
2013
def gth_solve(A, overwrite=False, use_jit=True):
2114
r"""
2215
This routine computes the stationary distribution of an irreducible
@@ -79,7 +72,7 @@ def gth_solve(A, overwrite=False, use_jit=True):
7972

8073
# if not using jit
8174
# === Reduction === #
82-
for k in xrange(n-1):
75+
for k in range(n-1):
8376
scale = np.sum(A1[k, k+1:n])
8477
if scale <= 0:
8578
# There is one (and only one) recurrent class contained in
@@ -93,7 +86,7 @@ def gth_solve(A, overwrite=False, use_jit=True):
9386

9487
# === Backward substitution === #
9588
x[n-1] = 1
96-
for k in xrange(n-2, -1, -1):
89+
for k in range(n-2, -1, -1):
9790
x[k] = np.dot(x[k+1:n], A1[k+1:n, k])
9891

9992
# === Normalization === #

0 commit comments

Comments
 (0)