[figures] make py3 compatible
This commit is contained in:
@@ -15,13 +15,13 @@ x = rng.randn(nsamples)
|
||||
|
||||
# bootstrap the mean:
|
||||
mus = []
|
||||
for i in xrange(nresamples) :
|
||||
for i in range(nresamples) :
|
||||
mus.append(np.mean(x[rng.randint(0, nsamples, nsamples)]))
|
||||
hmus, _ = np.histogram(mus, bins, density=True)
|
||||
|
||||
# many SRS:
|
||||
musrs = []
|
||||
for i in xrange(nresamples) :
|
||||
for i in range(nresamples) :
|
||||
musrs.append(np.mean(rng.randn(nsamples)))
|
||||
hmusrs, _ = np.histogram(musrs, bins, density=True)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ rd = np.corrcoef(x, y)[0, 1]
|
||||
# permutation:
|
||||
nperm = 1000
|
||||
rs = []
|
||||
for i in xrange(nperm) :
|
||||
for i in np.arange(nperm) :
|
||||
xr=rng.permutation(x)
|
||||
yr=rng.permutation(y)
|
||||
rs.append( np.corrcoef(xr, yr)[0, 1] )
|
||||
|
||||
Reference in New Issue
Block a user