diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-05-20 21:50:09 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-05-20 21:50:09 +0000 |
commit | d3133f1ed2d3c2e56853d14a5b3e5e1f2cff11e2 (patch) | |
tree | 7590c4f73a0a4e2009a8de860f49699e05bd5a94 /numpy/random/mtrand | |
parent | 260728f7a0010f717a246be1b199b93ea89c02fc (diff) | |
download | numpy-d3133f1ed2d3c2e56853d14a5b3e5e1f2cff11e2.tar.gz |
Docstring fixes: make some examples to work properly
Diffstat (limited to 'numpy/random/mtrand')
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index b3b676b9c..2bc2652fe 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -1279,8 +1279,8 @@ cdef class RandomState: >>> import matplotlib.pyplot as plt >>> import scipy.special as sps >>> count, bins, ignored = plt.hist(s, 50, normed=True) - >>> y = bins**(shape-1)*((exp(-bins/scale))/\\ - (sps.gamma(shape)*scale**shape)) + >>> y = bins**(shape-1)*(exp(-bins/scale) / + ... (sps.gamma(shape)*scale**shape)) >>> plt.plot(bins, y, linewidth=2, color='r') >>> plt.show() @@ -1672,8 +1672,8 @@ cdef class RandomState: >>> import matplotlib.pyplot as plt >>> import scipy.special as sps >>> count, bins, ignored = plt.hist(s, 50, normed=True) - >>> x = arange(-pi, pi, 2*pi/50.) - >>> y = -np.exp(kappa*np.cos(x-mu))/(2*pi*sps.jn(0,kappa)) + >>> x = np.arange(-np.pi, np.pi, 2*np.pi/50.) + >>> y = -np.exp(kappa*np.cos(x-mu))/(2*np.pi*sps.jn(0,kappa)) >>> plt.plot(x, y/max(y), linewidth=2, color='r') >>> plt.show() @@ -1858,6 +1858,7 @@ cdef class RandomState: the probability density function: >>> import matplotlib.pyplot as plt + >>> x = np.arange(1,100.)/50. >>> def weib(x,n,a): ... return (a / n) * (x / n)**(a - 1) * np.exp(-(x / n)**a) @@ -2619,7 +2620,7 @@ cdef class RandomState: >>> import scipy.special as sps Truncate s values at 50 so plot is interesting >>> count, bins, ignored = plt.hist(s[s<50], 50, normed=True) - >>> x = arange(1., 50.) + >>> x = np.arange(1., 50.) >>> y = x**(-a)/sps.zetac(a) >>> plt.plot(x, y/max(y), linewidth=2, color='r') >>> plt.show() |