![](https://secure.gravatar.com/avatar/b2ee81ab452e8516cb1891b56360f9e7.jpg?s=120&d=mm&r=g)
np.dtype(int)
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 dtype('int32')
type(argmin([2, 4, 5])) <type 'numpy.int64'>
np.dtype(int)
I believe the expected result on 64 bit numpy is what I get on Ubuntu with np 2.0.0 dev : dtype('int64') Could someone please confirm this ? -- thanks, peter butterworth
![](https://secure.gravatar.com/avatar/6c2496a73573bf0c9ac85f71db561475.jpg?s=120&d=mm&r=g)
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/
np.dtype(int)
Win64: np 1.5.1rc1 dtype('int32')
type(argmin([2, 4, 5])) <type 'numpy.int64'>
np.dtype(int)
I believe the expected result on 64 bit numpy is what I get on Ubuntu with np 2.0.0 dev : 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
![](https://secure.gravatar.com/avatar/b2ee81ab452e8516cb1891b56360f9e7.jpg?s=120&d=mm&r=g)
thanks for the clarification. I haven't found any complete guide on the subject, but it does appear there are a some potential gotchas with using numpy 64bit on windows (result type is not what the user might expect).
np.shape([1, 5, 4]) (3L,)
Is there a clear performance advantage for numpy 64bit over numpy 32bit on 64 bit windows ? I might be tempted to go back to 32bit python to <quote author="Christoph Gohlke"> 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 </quote> -- thanks, peter butterworth
![](https://secure.gravatar.com/avatar/6c2496a73573bf0c9ac85f71db561475.jpg?s=120&d=mm&r=g)
On 10/24/2010 1:41 AM, Peter Butterworth wrote:
thanks for the clarification.
I haven't found any complete guide on the subject, but it does appear there are a some potential gotchas with using numpy 64bit on windows (result type is not what the user might expect).
np.shape([1, 5, 4]) (3L,)
Correct and expected. Anyway, long integers and integer types have been unified in Python 3 (PEP 237).
Is there a clear performance advantage for numpy 64bit over numpy 32bit on 64 bit windows ? I might be tempted to go back to 32bit python to
It depends. You would have to benchmark your code. 64 bit code can actually be slower. But meeting wrong user expectations is not a comprehensible reason to me.
<quote author="Christoph Gohlke">
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 </quote>
-- Christoph
participants (2)
-
Christoph Gohlke
-
Peter Butterworth