[Numpy-discussion] round_() problems

Webb Sprague webb.sprague at gmail.com
Tue Mar 28 18:28:08 EST 2006


Hi all,

numpy.__version__ = 0.9.4

(After my svd question, I hope to follow up with something a tad less
silly.  Unfortunately, this a lot vaguer.)

I am getting the following backtrace when I try to round a matrix, but
I am not sure why (it works in other places...)  Has anyone seen this
error before, any explanation?  Anyway to get more information for
diagnosis?

The function the traceback hits only sets up an html table of rounded
matrix items, and it works for some matrices.  There is a possibility
the matrix I am feeding it is messed up, which is why I wanted to
print it....

Thanks, feel free to cc me as I read the list as a digest.

Begin traceback:

(import numpy as N)

 File "/var/www/localhost/htdocs/larry/LcUtil.py", line 120, in mat2table
    outStr += '' + str(N.round_(item,prec)) + ''

  File "/usr/lib/python2.4/site-packages/numpy/core/oldnumeric.py",
line 461, in round_
    a = absolute(multiply(a, 10.**decimals))

TypeError: unsupported operand type(s) for ** or pow(): 'float' and
'numpy.ndarray'




More information about the NumPy-Discussion mailing list