2009/2/21 <josef.pktd at gmail.com>: > I have a (dok) sparse distance matrix and I would like to take the > exponential of the distances I guess you could just as well switch to dense matrices then, since exp(0) is no longer zero. If you just want to change the non-zero values, you can use x.data = np.exp(x.data) Regards Stéfan