[Numpy-discussion] should ndarray implement __round__ for py3k?

Pauli Virtanen pav at iki.fi
Thu Mar 25 16:58:09 EDT 2010


Darren Dale wrote:
> A simple test in python 3:
>
> > > > import numpy as np
> > > > round(np.arange(10))
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> TypeError: type numpy.ndarray doesn't define __round__ method

I implemented this for array scalars already, but forgot about arrays. Anyway, it could be nice to have.

-- 
Pauli Virtanen



More information about the NumPy-Discussion mailing list