In [1]:
import numpy as np
In [2]:
a = np.arange(3)
print(a)
In [3]:
a_tile = np.tile(a, 3)
print(a_tile)
In [4]:
print(a)
In [5]:
print(np.tile(a, (2, 3)))
In [6]:
print(np.tile(a, (2, 3)).shape)
In [7]:
print(np.tile(a, (2, 3, 4)))
In [8]:
print(np.tile(a, (2, 3, 4)).shape)
In [9]:
a_2d = np.arange(6).reshape(2, 3)
print(a_2d)
In [10]:
print(np.tile(a_2d, 2))
In [11]:
print(np.tile(a_2d, (2, )))
In [12]:
print(np.tile(a_2d, (1, 2)))
In [13]:
print(np.tile(a_2d, (2, 1)))
In [14]:
print(np.tile(a_2d, (2, 2, 2)))
In [15]:
print(np.tile(a_2d, (2, 2, 2)).shape)