[SciPy-User] element-wise exponentiation

Marcel Blattner blattnem@gmail....
Thu Sep 9 06:14:12 CDT 2010

I have a beginners question. I have to exponentiate each element of a sparse
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?

-------------- 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