Is there a way to spread the values of a numpy array? Like an opposite to slicing with a step size > 1:
>>> a = np.array([[1, 0, 2], [0, 0, 0], [3, 0, 4]])
>>> a
array([[1, 0, 2],
[0, 0, 0],
[3, 0, 4]])
>>> b = a[::2, ::2]
>>> b
array([[1, 2],
[3, 4]])
In this example, is there an elegant way to get a
from b
?