[Numpy-discussion] Numpy large array bug

Francesc Alted faltet@pytables....
Mon Sep 21 13:30:38 CDT 2009


A Monday 21 September 2009 19:45:27 Kashyap Ashwin escrigué:
> Hello,
>
> I have downloaded numpy 1.3rc2 sources and compiled it on Ubuntu Hardy
> Linux x86_64. numpy.test() seems to run ok as well.
>
>
>
> Here is the bug I can reproduce
>
>
>
> import numpy as np
>
> a=np.zeros((2*1024*1024*1024 + 10000), dtype="uint8")
>
> a[:]=1
>
>
>
> # returns immediately
>
> a.mean()
>
> 0.0
>
>
>
> print a
>
> [0 0 0 ..., 0 0 0]
>
>
>
> The bug only happens when the nElements > 2G (2^31). So for
> dtype=uint16/32, the bug happens when size is greater thatn 2^31 as
> well.

Yup.  I can reproduce your problem with NumPy 1.3.0 (final) and a 64-bit 
platform.  I suppose that you should file a bug better.

-- 
Francesc Alted


More information about the NumPy-Discussion mailing list