summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-05-18 08:25:11 -0500
committerGitHub <noreply@github.com>2020-05-18 08:25:11 -0500
commit32ae22722fc1f665a90d16b110c219b1c24c857e (patch)
tree8ee24812dbe8cf346331bde81df7feae5bf4c3c4 /numpy/core/fromnumeric.py
parentfe610388a1f25c8d8ad80fbedd8117d91fdce9db (diff)
parentec95e33b98e63b2b5e7bac31400c2c30998e052f (diff)
downloadnumpy-32ae22722fc1f665a90d16b110c219b1c24c857e.tar.gz
Merge pull request #16278 from SacredArrow/var-doc-edit
DOC: Clarifications for ``np.var``.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index fa8941828..7193af839 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -3562,9 +3562,9 @@ def var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue):
Notes
-----
The variance is the average of the squared deviations from the mean,
- i.e., ``var = mean(abs(x - x.mean())**2)``.
+ i.e., ``var = mean(x)``, where ``x = abs(a - a.mean())**2``.
- The mean is normally calculated as ``x.sum() / N``, where ``N = len(x)``.
+ The mean is typically calculated as ``x.sum() / N``, where ``N = len(x)``.
If, however, `ddof` is specified, the divisor ``N - ddof`` is used
instead. In standard statistical practice, ``ddof=1`` provides an
unbiased estimator of the variance of a hypothetical infinite population.