diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2007-05-28 11:51:55 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2007-05-28 11:51:55 +0000 |
commit | 944c32ad4a0618c834dcb06e50e90267df1d6835 (patch) | |
tree | c5009067c582ec226b69e2267bb37dfa4c245d3d /numpy/lib/function_base.py | |
parent | 840bd64e600ac458b17fd058a181b860e87d56bd (diff) | |
download | numpy-944c32ad4a0618c834dcb06e50e90267df1d6835.tar.gz |
Select should not modify output arguments. Add test for basic select functionality.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index e038a4803..5d0d7c1a6 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -286,9 +286,7 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None): def average(a, axis=None, weights=None, returned=False): - """average(a, axis=None weights=None, returned=False) - - Average the array over the given axis. If the axis is None, + """Average the array over the given axis. If the axis is None, average over all dimensions of the array. Equivalent to a.mean(axis) and to @@ -452,7 +450,7 @@ def select(condlist, choicelist, default=0): n2 = len(choicelist) if n2 != n: raise ValueError, "list of cases must be same length as list of conditions" - choicelist.insert(0, default) + choicelist = [default] + choicelist S = 0 pfac = 1 for k in range(1, n+1): |