My goal is to shift the columns of an array B k positions to the left. Assume B is of the shape (n,n). Then of course, the columns from n to n-k have to replaced with some new entries. But this shouldn't be of importance here. What does work is the following:
for i in range(n):
for j in range(n-k):
B[i][j] = B[i][j+k]
I wonder if there is a faster and simpler method. Any suggestions appreciated