m = csr_matrix((data, (rows, columns)), shape=(1, 300))
indices = m.indices
m.indices = (indices + 1) % m.shape[1]
m.indices = (indices - 1) % m.shape[1]
How to implement Circular Permutation (left and right shift) of CSR_Matrix in Scipy Python Sparse Matrices?