I have a 500x500 sparse matrix with values ranging from 0 to a.
I want to change its elements according to a list working as a dictionary. Elements that equal 1 become the value of list(1), that equal 2 become the value of list(2), etc until values that equal a become list(a)
Is there a simple way to do this?