[Numpy-discussion] Complex128

Scott Sinclair scott.sinclair.za@gmail....
Tue Jul 20 01:17:18 CDT 2010


>On 19 July 2010 10:23, Pauli Virtanen <pav@iki.fi> wrote:
> Sun, 18 Jul 2010 21:15:15 -0500, Ross Harder wrote:
>
>> mac os x leopard 10.5..
>> EPD installed
>>
>> i just don't understand why i get one thing when i ask for another. i
>> can get what i want, but only by not asking for it.
>
> Do you get the same behavior also from
>
>        import numpy as np
>        np.array([0,0], dtype=np.complex256)

I see:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.4.1'
>>> np.array([0,0], dtype='Complex128')
array([0.0+0.0j, 0.0+0.0j], dtype=complex256)
>>> np.array([0,0], dtype='Complex64')
array([ 0.+0.j,  0.+0.j])
>>> np.array([0,0], dtype='Complex64').dtype
dtype('complex128')
>>> np.array([0,0], dtype='complex128')
array([ 0.+0.j,  0.+0.j])
>>> np.array([0,0], dtype='complex128').dtype
dtype('complex128')
>>> np.array([0,0], dtype='complex64')
array([ 0.+0.j,  0.+0.j], dtype=complex64)
>>> np.array([0,0], dtype=np.complex128)
array([ 0.+0.j,  0.+0.j])
>>> np.array([0,0], dtype=np.complex128).dtype
dtype('complex128')
>>> np.array([0,0], dtype=np.complex64)
array([ 0.+0.j,  0.+0.j], dtype=complex64)

on Ubuntu 64 bit.

Cheers,
Scott


More information about the NumPy-Discussion mailing list