This question has been asked before, but the solution only works for 1D / 2D arrays, and I need a more general answer.
How do you create a repeating array without data replication? This strikes me as something in common, as it would help to vectorize python operations without losing memory.
In particular, I have an array (y, x) that I want to alternate several times to create an array (z, y, x). I can do this with numpy.tile (array, (nz, 1,1)), but I'm out of memory. My specific case has x = 1500, y = 2000, z = 700.
source share