[SciPy-User] element-wise exponentiation

Marcel Blattner blattnem at gmail.com
Thu Sep 9 07:14:12 EDT 2010


Hi
I have a beginners question. I have to exponentiate each element of a sparse
lil-matrix.
I did:

a,b = A.nonzero()

for i in range(a.size):
      A[a[i],b[i]] = A[a[i],b[i]]**0.2

Is there a way to do something like A**0.2 like in numpy?

Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20100909/64e54483/attachment.html>


More information about the SciPy-User mailing list