[Numpy-svn] r3303 - in trunk/numpy: . lib

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Oct 10 18:16:17 CDT 2006


Author: stefan
Date: 2006-10-10 18:15:58 -0500 (Tue, 10 Oct 2006)
New Revision: 3303

Modified:
   trunk/numpy/add_newdocs.py
   trunk/numpy/lib/function_base.py
Log:
Simplify mean and average docstrings.


Modified: trunk/numpy/add_newdocs.py
===================================================================
--- trunk/numpy/add_newdocs.py	2006-10-10 20:27:23 UTC (rev 3302)
+++ trunk/numpy/add_newdocs.py	2006-10-10 23:15:58 UTC (rev 3303)
@@ -826,11 +826,10 @@
     """a.mean(axis=None, dtype=None)
 
       Average the array over the given axis.  If the axis is None,
-      average over all dimensions of the array.  If an integer axis
-      is given, this equals:
-          a.sum(axis, dtype) * 1.0 / len(a).
-      If axis is None, this equals:
-          a.sum(axis, dtype) * 1.0 / product(a.shape,axis=0)
+      average over all dimensions of the array.  Equivalent to
+
+        a.sum(axis, dtype) * 1.0 / size(a, axis).
+
       The optional dtype argument is the data type for intermediate
       calculations in the sum.;
 

Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2006-10-10 20:27:23 UTC (rev 3302)
+++ trunk/numpy/lib/function_base.py	2006-10-10 23:15:58 UTC (rev 3303)
@@ -230,15 +230,12 @@
 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
-    over all dimensions of the array.  Equivalent to a.mean(axis)
+    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
 
-    If an integer axis is given, this equals:
-        a.sum(axis) * 1.0 / len(a)
+      a.sum(axis) * 1.0 / size(a, axis)
 
-    If axis is None, this equals:
-        a.sum(axis) * 1.0 / product(a.shape,axis=0)
-
     If weights are given, result is:
         sum(a * weights,axis) / sum(weights,axis),
     where the weights must have a's shape or be 1D with length the



More information about the Numpy-svn mailing list