I would like to scale an array of shape (h, w) by a factor of n, resulting in an array of shape (h*n, w*n), with the.
Say that I have a 2x2 array:
ar
You could use repeat:
In [6]: a.repeat(2,axis=0).repeat(2,axis=1) Out[6]: array([[1, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1]])
I am not sure if there's a neat way to combine the two operations into one.