summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorJoseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>2016-07-14 01:44:03 -0400
committerGitHub <noreply@github.com>2016-07-14 01:44:03 -0400
commit9a3eb4bf7941cbc0238760d6b43bb55ee9a04057 (patch)
tree7ba26f731680b24e2b4cd4f5c563551356d3350e /numpy/core/fromnumeric.py
parent08fc49e1b33e4da9e14e375f399ba92c615eb569 (diff)
downloadnumpy-9a3eb4bf7941cbc0238760d6b43bb55ee9a04057.tar.gz
DOC: Added an example
It is not 100% clear that this will work properly for scalars, so I added an example that I thought was useful.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 28ee4fffa..7ec522abf 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -381,6 +381,8 @@ def repeat(a, repeats, axis=None):
Examples
--------
+ >>> np.repeat(3, 4)
+ array([3, 3, 3, 3])
>>> x = np.array([[1,2],[3,4]])
>>> np.repeat(x, 2)
array([1, 1, 2, 2, 3, 3, 4, 4])