I am working on a Python code so that I can basically do this with a Numpy Array
I have a Matlab code for it, which is
A = [1:30]'; % Example matrix
rows = 3;
for i=1:(numel(A)-rows+1)
B(1:rows,i)=A(i:i+rows-1,1);
end
or, without any loop,
B = conv2(A.', flip(eye(rows)));
B = B(:, rows:end-rows+1);
Can someone help me do the same in Python? Using the reshape function is not helping since I need to "mirror" the values (and not only reorganizing them).
Thank you.
