I see the post in the link: Rolling window for 1D arrays in Numpy?
but the code:
def rolling_window(array, window_size,freq):
shape = (array.shape[0] - window_size + 1, window_size)
strides = (array.strides[0],) + array.strides
rolled = np.lib.stride_tricks.as_strided(array, shape=shape, strides=strides)
return rolled[np.arange(0,shape[0],freq)]
rolling_window(Normalizados1linea,6199569,7)
doesn´t work in my array 1D My array`s type is Float64 And the size is 43396980
And here the error:
MemoryError: Unable to allocate 240. TiB for an array with shape (5313916, 6199569) and data type float64
I know is a memory issue, but what can I do?