On Thu, Jul 4, 2013 at 9:43 PM, Matti Picus <matti.pi...@gmail.com> wrote:

> round() does not consistently preserve subtype of the ndarray,
> is this known behaviour or should I file a bug for it?
>

That looks like a bug to me. The docstring explicitly says that return type
equals input type.

Ralf



> Python 2.7.3 (default, Sep 26 2012, 21:51:14)
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import numpy as np
>  >>> np.version.version
> '1.7.0'
>  >>> a=np.matrix(range(10))
>  >>> a.round(decimals=10)
> matrix([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]])
>  >>> a.round(decimals=-10)
> array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
>
> Matti
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to