[Numpy-discussion] floating point char - bug?

Charles R Harris charlesr.harris@gmail....
Sun Aug 31 14:28:50 CDT 2008


On Sun, Aug 31, 2008 at 1:14 PM, Christian K. <ckkart@hoc.net> wrote:

> Hi,
>
> I just came across somethin I never noticed before. I cannot say whether
> this is due to an update of numpy but it is possible - I am running
> 1.1.1 on __german__ windows. Here is the observation:
>
> a = N.linspace(0,1,5)
> a
> array([ 0.  ,  0.25,  0.5 ,  0.75,  1.  ])
> a.astype(float)
> array([ 0.  ,  0.25,  0.5 ,  0.75,  1.  ])
> a[0].astype(float)
> 0.0
> a[1].astype(float)
> 0,25
>
> As you see in the last line, suddenly numpy picks up the german locale
> setting and converts the floating point into a comma. It does not affect
> the '0.0' in the line above and I believe to have seen some other
> numbers ending with '.0' where the point has not been replaced.
> I guess this is a bug. In fact I do not like the idea that repr() of a
> numpy float honours the locale settings.
>

I'd call it a bug, file a ticket. And we do need to have a policy on
locales.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080831/ab212e9f/attachment-0001.html 


More information about the Numpy-discussion mailing list