[Numpy-discussion] Complex128

Pauli Virtanen pav@iki...
Tue Jul 20 03:31:42 CDT 2010


Tue, 20 Jul 2010 08:17:18 +0200, Scott Sinclair wrote:
[clip]
>>>> 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')

I think this is historical cruft from Numeric:

>>> import Numeric
>>> Numeric.Complex64
'D'
>>> Numeric.Complex32
'F'

There, the width of complex number was given by specifying the size of 
one element, not the total size.

Numpy should probably raise a DeprecationWarning when someone tries to 
use these old Numeric type codes.

-- 
Pauli Virtanen



More information about the NumPy-Discussion mailing list