summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorDieter Werthmüller <prisae@users.noreply.github.com>2019-07-11 15:59:41 +0200
committerGitHub <noreply@github.com>2019-07-11 15:59:41 +0200
commitf8aee9ae334b69a489873e11959faff3afff6d2a (patch)
tree4641ed4b250b532f27a886418a85c833c5dec2da /numpy/lib/function_base.py
parentbf487177ccf654c7c0ddf8dcacf7f2af20b14a11 (diff)
downloadnumpy-f8aee9ae334b69a489873e11959faff3afff6d2a.tar.gz
DOC: Change (old) range() to np.arange()
I think it should be like that (maybe I am mistaken).
Diffstat (limited to 'numpy/lib/function_base.py')
-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))