Skip to content

Commit

Permalink
Merge pull request numpy#13967 from prisae/patch-1
Browse files Browse the repository at this point in the history
DOC: Change (old) range() to np.arange()
  • Loading branch information
mattip authored Jul 11, 2019
2 parents 4bde15e + f8aee9a commit 4f7d5eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numpy/lib/function_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4f7d5eb

Please sign in to comment.