summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Werner <nils.werner@gmail.com>2014-11-20 08:26:13 +0100
committerNils Werner <nils.werner@gmail.com>2014-11-20 08:26:13 +0100
commite4d30698747b01d798ee7aac565bf290f6b0f5b7 (patch)
treeb2295f62e3c0cb68992c5afd94644cf33b4e9d93
parent8bcb7569c92dc94d5b1516e7d33608bbd041a6bf (diff)
downloadnumpy-e4d30698747b01d798ee7aac565bf290f6b0f5b7.tar.gz
Resize: Show an example that explains the potentially confusing behaviour of resize
-rw-r--r--numpy/core/fromnumeric.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 28c1c7d75..84a10bf04 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1088,6 +1088,9 @@ def resize(a, new_shape):
Examples
--------
>>> a=np.array([[0,1],[2,3]])
+ >>> np.resize(a,(2,3))
+ array([[0, 1, 2],
+ [3, 0, 1]])
>>> np.resize(a,(1,4))
array([[0, 1, 2, 3]])
>>> np.resize(a,(2,4))