[Numpy-discussion] Problem with trace function?
Rosenfellner Gerald VAI.ISC 1
Gerald.Rosenfellner at vai.at
Thu Dec 2 02:34:01 CST 2004
Hi all,
I have some trouble with the new numarray library.
Most of the time the numarray code prints out some negative value
whereas the
Numeric code yields positive values.
This behaviour justs shows up when using large arrays.
Can anybody point out what I need to change in the numarray version to
get the Numeric behaviour?
System: WinXP, python2.3.4, Numeric23.5, numarray1.1.1
-----
NUMARRAY-VERSION:
from numarray import greater, reshape, trace
from numarray.random_array import standard_normal
n=1000
A = greater(standard_normal(n*n), 0.9)
A = reshape(A, (n, n))
print trace(A)
-----
NUMERIC-Version:
from Numeric import greater, reshape, trace
from RandomArray import standard_normal
n=1000
A = greater(standard_normal(n*n), 0.9)
A = reshape(A, (n, n))
print trace(A)
-----
Thank you for your help.
Gerald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20041202/324399a5/attachment.html
More information about the Numpy-discussion
mailing list