summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-11-25 17:00:17 -0700
committerCharles Harris <charlesr.harris@gmail.com>2015-11-25 17:00:17 -0700
commit53e658f80da6a50d371c74f49d3bb81fabf20d1b (patch)
tree2021c4b0095abfc3c0b68f9de3721f9dedb19a98
parentb9a06adca048cd5884f5862c08821852b1c48da8 (diff)
parent4ac1740eaefa89b495171d8a5862ae2d1cacc5da (diff)
downloadnumpy-53e658f80da6a50d371c74f49d3bb81fabf20d1b.tar.gz
Merge pull request #6627 from ordirules/master
added extra line in the tile help doc to outline a general repeat, co…
-rw-r--r--numpy/lib/shape_base.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index 615cf88f4..ffbe56721 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -799,6 +799,9 @@ def tile(A, reps):
Thus for an `A` of shape (2, 3, 4, 5), a `reps` of (2, 2) is treated as
(1, 1, 2, 2).
+ Note : Although tile may be used for broadcasting, it is strongly
+ recommended to use numpy's broadcasting operations and functions.
+
Parameters
----------
A : array_like
@@ -814,6 +817,7 @@ def tile(A, reps):
See Also
--------
repeat : Repeat elements of an array.
+ broadcast_to : Broadcast an array to a new shape
Examples
--------
@@ -837,6 +841,12 @@ def tile(A, reps):
[1, 2],
[3, 4]])
+ >>> c = np.array([1,2,3,4])
+ >>> np.tile(c,(4,1))
+ array([[1, 2, 3, 4],
+ [1, 2, 3, 4],
+ [1, 2, 3, 4],
+ [1, 2, 3, 4]])
"""
try:
tup = tuple(reps)