NumPy tile repeats an array as a block rather than repeating each element in place
Two outputs can contain the same values the same number of times and still arrange them differently. Academia Master Trader explains NumPy tile in English for readers in Iceland. We will repeat a small matrix across columns and down rows, then compare that block pattern with repeating individual elements. The aim is to read the repetition factors together with the original shape. A larger array in these examples is a constructed arrangement of existing data, not a record of additional observations or a financial outcome.
Define the block before repeating it
After import numpy as np, define a = np.array([[8,3],[2,9]]). Its shape is (2,2), which means two rows and two columns. Eight and three form the first row; two and nine form the second. This complete two by two arrangement is the block we will repeat. There are four elements in the input.
The function np.tile takes the input and a reps argument describing the number of repetitions along each axis. For our two dimensional input, a pair of factors can describe the row and column repetition separately. A factor of one keeps a single occurrence along that axis. It does not add an extra occurrence to the original.
Repeat the block across columns
The call np.tile(a,(1,2)) gives [[8,3,8,3],[2,9,2,9]] with shape (2,4). The row factor is one and the column factor is two. The original block appears twice across the column direction. The first output row is eight, three, eight and three. The second is two, nine, two and nine.
The order inside the repeated block is important. Eight is followed by three, not by another eight. The pattern is a copy of the whole two column width. Reading only the total number of eights would miss that structure. Follow the first input row as a sequence and you can see where one block ends and the next block begins.
Repeat the block down rows
The call np.tile(a,(2,1)) gives [[8,3],[2,9],[8,3],[2,9]] with shape (4,2). The row factor is now two and the column factor is one. The original two rows appear, followed by the same two rows again. The input's second row remains between the first and third output rows.
This differs from repeating each row twice in succession. That would place the first row immediately after itself, followed by two appearances of the second row. Tile instead repeats the complete row pattern of the block. The distinction can be seen without changing any numbers: compare the second output row, which is two and nine in our tiled result.

Read the figure as separate calls
The figure shows the original block, the two explicit pairs of factors and the shorter call np.tile(a,2). Each output starts from the same input. The panels are not consecutive operations. With this two dimensional array, the single factor two is treated as repetition factors (1,2), so the shorter call also produces shape (2,4) and the same values as the column repetition panel.
The documentation explains this alignment rule more generally. When the input has more dimensions than the number of supplied factors, ones are placed before those factors. For a two dimensional input and one factor, that creates the pair one and two. Do not read the shorter call as a request to double every dimension. Here the number of rows remains two.
Compare block repetition with element repetition
For the same input, np.repeat(a,2,axis=1) gives [[8,8,3,3],[2,2,9,9]]. This has the same shape (2,4) as np.tile(a,(1,2)), but different positions. Repeat groups each element's appearances together; tile repeats the input block pattern. Matching shapes and matching element counts do not establish that two operations produced the same arrangement.
The NumPy documentation also advises using broadcasting operations and functions when the purpose is broadcasting, rather than using tile for that purpose. This lesson focuses on reading explicit tiled output. It does not claim that constructing repeated arrays is the best choice for every later calculation. Choose an operation from what the next step needs, not from the appearance of one small example alone.
Continue learning with Academia Master Trader at academiamastertrader.com.br and in Aprenda. Write the input block, match each factor to its axis and mark where the repeated block starts again. Then confirm the output shape. This keeps tile distinct from repeating individual elements and keeps constructed repetition separate from newly collected information.