[figures] make py3 compatible

This commit is contained in:
2018-11-02 11:01:31 +01:00
parent 61bdeb160a
commit 780fba24c4
10 changed files with 19 additions and 19 deletions

View File

@@ -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)

View File

@@ -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] )