diff options
author | cookedm <cookedm@localhost> | 2006-07-18 21:10:39 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-07-18 21:10:39 +0000 |
commit | d5a13c5e4d881a205bef6ce64cb2222aef98d43c (patch) | |
tree | b57b99aa0d926ced857f526fd0ab0472be811da4 /numpy/core | |
parent | ba41f2f5d864551b4462a9f53e8f23f626b11105 (diff) | |
download | numpy-d5a13c5e4d881a205bef6ce64cb2222aef98d43c.tar.gz |
add some more docstrings
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/fromnumeric.py | 10 | ||||
-rw-r--r-- | numpy/core/src/arraymethods.c | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index bfd8a1e0d..c3b5d031f 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -468,9 +468,17 @@ def mean(a, axis=0, dtype=None): mean = a.mean except AttributeError: return _wrapit(a, 'mean', axis, dtype) - return mean(axis, dtype) + return mean(axis, dtype) def std(a, axis=0, dtype=None): + """std(sample, axis=0, dtype=None) + Return the standard deviation, a measure of the spread of a distribution. + + The standard deviation is the square root of the average of the squared + deviations from the mean, i.e. std = sqrt(mean((x - x.mean())**2)). + + For multidimensional arrays, std is computed by default along the first axis. + """ try: std = a.std except AttributeError: diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 757df2ef5..c01d3db4b 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -1385,7 +1385,13 @@ array_all(PyArrayObject *self, PyObject *args, PyObject *kwds) return PyArray_All(self, axis); } -static char doc_stddev[] = "a.std(axis=None, dtype=None)"; +static char doc_stddev[] = "a.std(axis=None, dtype=None)\n" +"Return the standard deviation, a measure of the spread of a distribution.\n" +"\n" +"The standard deviation is the square root of the average of the squared\n" +"deviations from the mean, i.e. std = sqrt(mean((x - x.mean())**2)).\n" +"\n" +"For multidimensional arrays, std is computed by default along the first axis.\n"; static PyObject * array_stddev(PyArrayObject *self, PyObject *args, PyObject *kwds) |