I have the following code, which I\'d like to optimize. Unfortunately, I can\'t find a way to gain speed or vectorize anything.
from scipy.sparse import diags imp