NumPy tile repeats a whole array pattern rather than grouping copies of each entry
A repeated pattern preserves the order inside its source block. This differs from copying each entry several times before moving to the next one. Academia Master Trader explains NumPy tile in English for readers in Montenegro. We will tile a short sequence, add a row dimension and compare horizontal and vertical copies of a matrix. The expanded arrays contain repeated supplied values. They do not represent new observations, new measurements or evidence of financial performance.
Start with one complete pattern
After import numpy as np, define x = np.array([8,3,6]). The call np.tile(x,2) returns [8,3,6,8,3,6]. The original three entry sequence appears twice in the output. Its internal order remains eight, three, six in each appearance. The input shape is (3,), and the output shape is (6,).
The argument two specifies two total copies of the pattern, not two additional copies after the original. Separating the output visually into [8,3,6] followed by [8,3,6] makes that meaning explicit. Each original entry appears twice, but its appearances are separated by the other members of the pattern. This spacing is an important difference from consecutive entry repetition.
Compare tile with repeat using the same input
The call np.repeat(x,2) returns [8,8,3,3,6,6]. Its length is also six, but its grouping differs. Repeat places each value's copies next to one another. Tile copies the complete sequence before starting the next copy. Both operations expand this input, yet their outputs answer different arrangement requests.
For tile, output positions zero through two contain the first pattern and positions three through five contain the second. Eight occurs at indices zero and three. For repeat, eight occurs at zero and one instead. Track one original entry and the boundaries of its group before concluding that two similarly sized outputs are equivalent. A shared shape does not establish a shared order.

Read the figure by complete blocks
The figure places the original sequence above the tiled result and the repeated entry result. Matching colours identify eight, three and six in each row. In the tiled row, read the colour sequence twice from left to right. In the repeat row, read adjacent pairs of each colour. The same original values appear in both rows, but their positions explain the difference.
All displayed numbers come from the original sequence. Repetition does not add information about a population or a time period merely by increasing the number of entries. If these values represented observations, copied appearances would still be copies. Keep the source block and the repetition rule visible whenever a larger array is used to illustrate structure.
Give a repetition count for each dimension
The call np.tile(x,(2,2)) returns [[8,3,6,8,3,6],[8,3,6,8,3,6]], with shape (2,6). The two supplied repetition counts describe a two dimensional arrangement. NumPy treats the one dimensional source as shape (1,3) for this operation, adding a leading axis. The first count creates two rows, and the second count places two source patterns along each row.
The original x remains a one dimensional array; this promotion describes how tile interprets it while constructing the result. It is not a change to x itself. Writing the promoted shape (1,3) before the final shape (2,6) helps explain why two repetition counts can produce a two dimensional result from a one dimensional input.
Distinguish horizontal and vertical matrix copies
Define a = np.array([[8,3],[2,9]]), with shape (2,2). The call np.tile(a,(1,2)) returns [[8,3,8,3],[2,9,2,9]], with shape (2,4). It copies the whole matrix horizontally. By contrast, np.tile(a,(2,1)) returns [[8,3],[2,9],[8,3],[2,9]], with shape (4,2), copying the whole matrix vertically.
For this two dimensional source, np.tile(a,2) is equivalent to the horizontal case because the shorter repetition specification is given a leading one. Continue learning with Academia Master Trader at academiamastertrader.com.br and in Aprenda. Record the source shape, repetition counts and complete block boundaries. Those checks keep pattern copies distinct from entry copies and make the resulting dimensions clear.