diff options
author | Tim Leslie <tim.leslie@gmail.com> | 2007-01-09 04:45:31 +0000 |
---|---|---|
committer | Tim Leslie <tim.leslie@gmail.com> | 2007-01-09 04:45:31 +0000 |
commit | e56a09af9e696129b92e7487bccbc3713568fc5b (patch) | |
tree | 1257c10ae62f2847ac22f48e502eafeef7632820 /numpy/oldnumeric/random_array.py | |
parent | 4d9b87ec11dc268bb9069831deab466ffe47ad93 (diff) | |
download | numpy-e56a09af9e696129b92e7487bccbc3713568fc5b.tar.gz |
clean up unused imports and bad whitespace
Diffstat (limited to 'numpy/oldnumeric/random_array.py')
-rw-r--r-- | numpy/oldnumeric/random_array.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/numpy/oldnumeric/random_array.py b/numpy/oldnumeric/random_array.py index 84e923e13..0b06ee959 100644 --- a/numpy/oldnumeric/random_array.py +++ b/numpy/oldnumeric/random_array.py @@ -72,30 +72,30 @@ def standard_normal(shape=[]): return mt.standard_normal(shape) def normal(mean, std, shape=[]): - """normal(mean, std, n) or normal(mean, std, [n, m, ...]) returns - array of random numbers randomly distributed with specified mean and - standard deviation""" - if shape == []: - shape = None - return mt.normal(mean, std, shape) + """normal(mean, std, n) or normal(mean, std, [n, m, ...]) returns + array of random numbers randomly distributed with specified mean and + standard deviation""" + if shape == []: + shape = None + return mt.normal(mean, std, shape) def multivariate_normal(mean, cov, shape=[]): - """multivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...]) - returns an array containing multivariate normally distributed random numbers - with specified mean and covariance. - - mean must be a 1 dimensional array. cov must be a square two dimensional - array with the same number of rows and columns as mean has elements. - - The first form returns a single 1-D array containing a multivariate - normal. - - The second form returns an array of shape (m, n, ..., cov.shape[0]). - In this case, output[i,j,...,:] is a 1-D array containing a multivariate - normal.""" - if shape == []: - shape = None - return mt.multivariate_normal(mean, cov, shape) + """multivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...]) + returns an array containing multivariate normally distributed random numbers + with specified mean and covariance. + + mean must be a 1 dimensional array. cov must be a square two dimensional + array with the same number of rows and columns as mean has elements. + + The first form returns a single 1-D array containing a multivariate + normal. + + The second form returns an array of shape (m, n, ..., cov.shape[0]). + In this case, output[i,j,...,:] is a 1-D array containing a multivariate + normal.""" + if shape == []: + shape = None + return mt.multivariate_normal(mean, cov, shape) def exponential(mean, shape=[]): """exponential(mean, n) or exponential(mean, [n, m, ...]) returns array @@ -195,8 +195,8 @@ def mean_var_test(x, type, mean, var, skew=[]): print "(should be about ", mean, "):", x_mean print "Variance of those random numbers (should be about ", var, "):", x_var if skew != []: - x_skew = (Numeric.sum(x_minus_mean*x_minus_mean*x_minus_mean,axis=0)/9998.)/x_var**(3./2.) - print "Skewness of those random numbers (should be about ", skew, "):", x_skew + x_skew = (Numeric.sum(x_minus_mean*x_minus_mean*x_minus_mean,axis=0)/9998.)/x_var**(3./2.) + print "Skewness of those random numbers (should be about ", skew, "):", x_skew def test(): obj = mt.get_state() |