[Numpy-discussion] np.dtype(int) 64bit
Christoph Gohlke
cgohlke at uci.edu
Sat Oct 23 20:06:02 EDT 2010
On 10/23/2010 2:32 PM, Peter Butterworth wrote:
> Hi,
>
> I'm getting some strange behaviour from 64bit numpy on windows. I'm
> using the win64 mkl builds of numpy from :
> http://www.lfd.uci.edu/~gohlke/pythonlibs/
>
> Win64: np 1.5.1rc1
>>>> np.dtype(int)
> dtype('int32')
>
>>>> type(argmin([2, 4, 5]))
> <type 'numpy.int64'>
>
>
> I believe the expected result on 64 bit numpy is what I get on Ubuntu
> with np 2.0.0 dev :
>>>> np.dtype(int)
> dtype('int64')
>
> Could someone please confirm this ?
>
>
Looks correct. CPython's 'int' is implemented as 'long' in C, which is
32 bit on Windows (LLP64 model) and 64 bit on other systems (LP64, etc).
The function argmin() returns an index, which is implemented as
'Py_ssize_t' in C and is 64 bit on all 64 bit systems.
--
Christoph
More information about the NumPy-Discussion
mailing list