2
2
unicode_literals )
3
3
4
4
import six
5
- from six .moves import zip , zip_longest
5
+ from six .moves import xrange , zip , zip_longest
6
6
7
7
import functools
8
8
import itertools
@@ -3923,7 +3923,7 @@ def dopatch(xs, ys, **kwargs):
3923
3923
else :
3924
3924
def doplot (* args , ** kwargs ):
3925
3925
shuffled = []
3926
- for i in range (0 , len (args ), 2 ):
3926
+ for i in xrange (0 , len (args ), 2 ):
3927
3927
shuffled .extend ([args [i + 1 ], args [i ]])
3928
3928
return self .plot (* shuffled , ** kwargs )
3929
3929
@@ -3937,7 +3937,7 @@ def dopatch(xs, ys, **kwargs):
3937
3937
"values must have same the length" )
3938
3938
# check position
3939
3939
if positions is None :
3940
- positions = list (range (1 , N + 1 ))
3940
+ positions = list (xrange (1 , N + 1 ))
3941
3941
elif len (positions ) != N :
3942
3942
raise ValueError (datashape_message .format ("positions" ))
3943
3943
@@ -4558,31 +4558,31 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
4558
4558
4559
4559
# create accumulation arrays
4560
4560
lattice1 = np .empty ((nx1 , ny1 ), dtype = object )
4561
- for i in range (nx1 ):
4562
- for j in range (ny1 ):
4561
+ for i in xrange (nx1 ):
4562
+ for j in xrange (ny1 ):
4563
4563
lattice1 [i , j ] = []
4564
4564
lattice2 = np .empty ((nx2 , ny2 ), dtype = object )
4565
- for i in range (nx2 ):
4566
- for j in range (ny2 ):
4565
+ for i in xrange (nx2 ):
4566
+ for j in xrange (ny2 ):
4567
4567
lattice2 [i , j ] = []
4568
4568
4569
- for i in range (len (x )):
4569
+ for i in xrange (len (x )):
4570
4570
if bdist [i ]:
4571
4571
if 0 <= ix1 [i ] < nx1 and 0 <= iy1 [i ] < ny1 :
4572
4572
lattice1 [ix1 [i ], iy1 [i ]].append (C [i ])
4573
4573
else :
4574
4574
if 0 <= ix2 [i ] < nx2 and 0 <= iy2 [i ] < ny2 :
4575
4575
lattice2 [ix2 [i ], iy2 [i ]].append (C [i ])
4576
4576
4577
- for i in range (nx1 ):
4578
- for j in range (ny1 ):
4577
+ for i in xrange (nx1 ):
4578
+ for j in xrange (ny1 ):
4579
4579
vals = lattice1 [i , j ]
4580
4580
if len (vals ) > mincnt :
4581
4581
lattice1 [i , j ] = reduce_C_function (vals )
4582
4582
else :
4583
4583
lattice1 [i , j ] = np .nan
4584
- for i in range (nx2 ):
4585
- for j in range (ny2 ):
4584
+ for i in xrange (nx2 ):
4585
+ for j in xrange (ny2 ):
4586
4586
vals = lattice2 [i , j ]
4587
4587
if len (vals ) > mincnt :
4588
4588
lattice2 [i , j ] = reduce_C_function (vals )
@@ -6480,7 +6480,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6480
6480
'weights should have the same shape as x' )
6481
6481
6482
6482
if color is None :
6483
- color = [self ._get_lines .get_next_color () for i in range (nx )]
6483
+ color = [self ._get_lines .get_next_color () for i in xrange (nx )]
6484
6484
else :
6485
6485
color = mcolors .to_rgba_array (color )
6486
6486
if len (color ) != nx :
@@ -6507,7 +6507,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6507
6507
tops = []
6508
6508
mlast = None
6509
6509
# Loop through datasets
6510
- for i in range (nx ):
6510
+ for i in xrange (nx ):
6511
6511
# this will automatically overwrite bins,
6512
6512
# so that each histogram uses the same bins
6513
6513
m , bins = np .histogram (x [i ], bins , weights = w [i ], ** hist_kwargs )
0 commit comments