summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-07-11 13:03:18 -0500
committerGitHub <noreply@github.com>2019-07-11 13:03:18 -0500
commit4f7d5eb13394ec2b13fe9e22855fa009579cb49b (patch)
tree130e2d64ebe8e6c8b569c12d5ac9e61bbafb14cb
parent4bde15e328cb9b8cc1c75d27c05de23414b429f1 (diff)
parentf8aee9ae334b69a489873e11959faff3afff6d2a (diff)
downloadnumpy-4f7d5eb13394ec2b13fe9e22855fa009579cb49b.tar.gz
Merge pull request #13967 from prisae/patch-1
DOC: Change (old) range() to np.arange()
-rw-r--r--numpy/lib/function_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index cf7246402..9d380e67d 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -358,12 +358,12 @@ def average(a, axis=None, weights=None, returned=False):
Examples
--------
- >>> data = list(range(1,5))
+ >>> data = np.arange(1, 5)
>>> data
- [1, 2, 3, 4]
+ array([1, 2, 3, 4])
>>> np.average(data)
2.5
- >>> np.average(range(1,11), weights=range(10,0,-1))
+ >>> np.average(np.arange(1, 11), weights=np.arange(10, 0, -1))
4.0
>>> data = np.arange(6).reshape((3,2))