diff --git a/examples/parallel/pi/pidigits.py b/examples/parallel/pi/pidigits.py index 33dc82d..98898de 100644 --- a/examples/parallel/pi/pidigits.py +++ b/examples/parallel/pi/pidigits.py @@ -20,7 +20,6 @@ from __future__ import division, with_statement import numpy as np from matplotlib import pyplot as plt -from six import advance_iterator # Top-level functions @@ -100,8 +99,8 @@ def two_digit_freqs(digits, normalize=False): Consume digits of pi and compute 2 digits freq. counts. """ freqs = np.zeros(100, dtype='i4') - last = advance_iterator(digits) - this = advance_iterator(digits) + last = next(digits) + this = next(digits) for d in digits: index = int(last + this) freqs[index] += 1 @@ -120,7 +119,7 @@ def n_digit_freqs(digits, n, normalize=False): freqs = np.zeros(pow(10,n), dtype='i4') current = np.zeros(n, dtype=int) for i in range(n): - current[i] = advance_iterator(digits) + current[i] = next(digits) for d in digits: index = int(''.join(map(str, current))) freqs[index] += 1