diff options
author | Brigitta Sipocz <bsipocz@gmail.com> | 2019-10-15 17:41:09 -0700 |
---|---|---|
committer | Brigitta Sipocz <bsipocz@gmail.com> | 2019-10-15 17:41:09 -0700 |
commit | 1d4cd73c520ff7f91aef598a80534504909fd05b (patch) | |
tree | 15da95e6ce4ae0e417d038f3db07caca0bfa8dfe /doc | |
parent | 909abb07508b99b1907ace88e8452c68c7fa886b (diff) | |
download | numpy-1d4cd73c520ff7f91aef598a80534504909fd05b.tar.gz |
DOC: avoid using random array in example
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/reference/maskedarray.generic.rst | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/source/reference/maskedarray.generic.rst b/doc/source/reference/maskedarray.generic.rst index 0b5feefeb..06bdb2e9b 100644 --- a/doc/source/reference/maskedarray.generic.rst +++ b/doc/source/reference/maskedarray.generic.rst @@ -487,11 +487,10 @@ the last two where the inputs were masked. Ignoring extreme values ----------------------- -Let's consider an array ``d`` of random floats between 0 and 1. We wish to +Let's consider an array ``d`` of floats between 0 and 1. We wish to compute the average of the values of ``d`` while ignoring any data outside -the range ``[0.1, 0.9]``:: +the range ``[0.2, 0.9]``:: - >>> np.random.seed(42) - >>> d = np.random.random(10) - >>> print(d.mean() - ma.masked_outside(d, 0.1, 0.9).mean()) - -0.003934444165904272 + >>> d = np.linspace(0, 1, 20) + >>> print(d.mean() - ma.masked_outside(d, 0.2, 0.9).mean()) + -0.05263157894736836 |