[Numpy-discussion] rounding all element of an array with more than 1d

Giorgio Luciano giorgio.luciano at chimica.unige.it
Mon Jan 15 03:31:27 EST 2007


I've posted also to scipy group but with no luck.
At first I thought it was an easy task but...
I've to round the numbers inside of a 2d array but nothing seems to 
work. the only message I've found in the archive is an old function 
custom made for doing that.. wouldn't be useful to have it also included 
something that do this task in numpy ?
 here's and example of the error using round


Traceback (most recent call last):
  File "<pyshell#25>", line 1, in <module>
    round(vp)
TypeError: only length-1 arrays can be converted to Python scalars

Any feedback appreciated



More information about the NumPy-Discussion mailing list