Python
numpy

numpy.tile example

Z = np.tile( np.array([[0,1],[1,0]]), (4,4))
print(Z)
Z = np.tile( np.array([[0,1],[1,0],[3,9]]), (2,3,5))
print(Z)
[[0 1 0 1 0 1 0 1]
 [1 0 1 0 1 0 1 0]
 [0 1 0 1 0 1 0 1]
 [1 0 1 0 1 0 1 0]
 [0 1 0 1 0 1 0 1]
 [1 0 1 0 1 0 1 0]
 [0 1 0 1 0 1 0 1]
 [1 0 1 0 1 0 1 0]]
[[[0 1 0 1 0 1 0 1 0 1]
  [1 0 1 0 1 0 1 0 1 0]
  [3 9 3 9 3 9 3 9 3 9]
  [0 1 0 1 0 1 0 1 0 1]
  [1 0 1 0 1 0 1 0 1 0]
  [3 9 3 9 3 9 3 9 3 9]
  [0 1 0 1 0 1 0 1 0 1]
  [1 0 1 0 1 0 1 0 1 0]
  [3 9 3 9 3 9 3 9 3 9]]

 [[0 1 0 1 0 1 0 1 0 1]
  [1 0 1 0 1 0 1 0 1 0]
  [3 9 3 9 3 9 3 9 3 9]
  [0 1 0 1 0 1 0 1 0 1]
  [1 0 1 0 1 0 1 0 1 0]
  [3 9 3 9 3 9 3 9 3 9]
  [0 1 0 1 0 1 0 1 0 1]
  [1 0 1 0 1 0 1 0 1 0]
  [3 9 3 9 3 9 3 9 3 9]]]
  • Z,row,column