I have a 2d numpy array (2 x 2) elements, I want to create another 2D numpy array out of it, such that:
2D array:
import numpy as np
np.random.rand(2,2)
array([[10.0,8.0], [6.0,4.0]])
I want to get a 4x4 array out of it such that all values of the finer resolution array corresponding to a specific cell of the coarser array, are the same as the coarser array:
array([[10.0,10.0,8.0,8.0], [10.0,10.0,8.0,8.0] [6.0,6.0,4.0,4.0] [6.0,6.0,4.0,4.0]])
I could do this using for loops, but would really like to find out if a more pythonic way exists.