diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-29 10:28:11 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-29 10:28:11 +0000 |
commit | 775a47de7e2f4b039592d614e7ac3fda464975a8 (patch) | |
tree | 6ec0d74f0505ba0e60f3ee01af70b4669ec38475 /numpy/oldnumeric/rng_stats.py | |
parent | ce7a968a7b5cdb328ca1ea222211ad9cd8e506ad (diff) | |
download | numpy-775a47de7e2f4b039592d614e7ac3fda464975a8.tar.gz |
Add axis arguments to various functions so as not to rely on the defaults.
Diffstat (limited to 'numpy/oldnumeric/rng_stats.py')
-rw-r--r-- | numpy/oldnumeric/rng_stats.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/oldnumeric/rng_stats.py b/numpy/oldnumeric/rng_stats.py index 60248247e..8c7fec433 100644 --- a/numpy/oldnumeric/rng_stats.py +++ b/numpy/oldnumeric/rng_stats.py @@ -9,7 +9,7 @@ def average(data): def variance(data): data = Numeric.array(data) - return Numeric.add.reduce((data-average(data))**2)/(len(data)-1) + return Numeric.add.reduce((data-average(data,axis=0))**2)/(len(data)-1) def standardDeviation(data): data = Numeric.array(data) @@ -25,7 +25,7 @@ def histogram(data, nbins, range = None): data = Numeric.repeat(data, Numeric.logical_and(Numeric.less_equal(data, max), Numeric.greater_equal(data, - min))) + min)),axis=0) bin_width = (max-min)/nbins data = Numeric.floor((data - min)/bin_width).astype(Numeric.Int) histo = Numeric.add.reduce(Numeric.equal( |