diff options
author | Alan McIntyre <alan.mcintyre@local> | 2008-09-13 18:10:48 +0000 |
---|---|---|
committer | Alan McIntyre <alan.mcintyre@local> | 2008-09-13 18:10:48 +0000 |
commit | 83eba775c46704a969826eb1990be80e35c65255 (patch) | |
tree | b7462dcedf8c6c99c713ad096334a081df776970 /numpy/oldnumeric/rng.py | |
parent | e8b5097f886ca58ff5713886f8378d2b233c418b (diff) | |
download | numpy-83eba775c46704a969826eb1990be80e35c65255.tar.gz |
Rewrapped __all__ definition to conform to PEP8.
Standardize NumPy import as "import numpy as np".
Removed unused imports.
Fixed undefined reference to ndarray (should be np.ndarray).
Fixed undefined references to exp (should be math.exp).
Diffstat (limited to 'numpy/oldnumeric/rng.py')
-rw-r--r-- | numpy/oldnumeric/rng.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/oldnumeric/rng.py b/numpy/oldnumeric/rng.py index fcf08bb37..b4c72a68c 100644 --- a/numpy/oldnumeric/rng.py +++ b/numpy/oldnumeric/rng.py @@ -4,9 +4,9 @@ # It is for backwards compatibility only. -__all__ = ['CreateGenerator','ExponentialDistribution','LogNormalDistribution','NormalDistribution', - 'UniformDistribution', 'error', 'default_distribution', 'random_sample', 'ranf', - 'standard_generator'] +__all__ = ['CreateGenerator','ExponentialDistribution','LogNormalDistribution', + 'NormalDistribution', 'UniformDistribution', 'error', 'ranf', + 'default_distribution', 'random_sample', 'standard_generator'] import numpy.random.mtrand as mt import math @@ -44,7 +44,7 @@ class ExponentialDistribution(Distribution): return 0.0 else: lambda_ = self._args[0] - return lambda_*exp(-lambda_*x) + return lambda_*math.exp(-lambda_*x) class LogNormalDistribution(Distribution): def __init__(self, m, s): @@ -61,7 +61,7 @@ class LogNormalDistribution(Distribution): def density(x): m,s = self._args y = (math.log(x)-self._mn)/self._sn - return self._fac*exp(-0.5*y*y)/x + return self._fac*math.exp(-0.5*y*y)/x class NormalDistribution(Distribution): @@ -76,7 +76,7 @@ class NormalDistribution(Distribution): def density(x): m,s = self._args y = (x-m)/s - return self._fac*exp(-0.5*y*y) + return self._fac*math.exp(-0.5*y*y) class UniformDistribution(Distribution): def __init__(self, a, b): |