I don't understand the following.
a=np.zeros( (3,3,3), dtype='Complex128')
a array([[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]],
[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]], [[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]]], dtype=complex256) i ask for Complex128 and get complex256? if i ask for complex128 (little c) I get complex128 if i ask for complex (little c) i get complex128 if i ask for Complex (cap C) i get unrecognized type
Sun, 18 Jul 2010 17:26:13 -0500, Ross Harder wrote:
I don't understand the following.
a=np.zeros( (3,3,3), dtype='Complex128')
a array([[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]],
[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]],
[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]]], dtype=complex256)
i ask for Complex128 and get complex256?
What platform? On Win-64 longdouble == double. Of course, the byte-width names should still reflect the reality. Please file a bug ticket... -- Pauli Virtanen
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. thanks, Ross On Sun, Jul 18, 2010 at 6:02 PM, Pauli Virtanen <pav@iki.fi> wrote:
Sun, 18 Jul 2010 17:26:13 -0500, Ross Harder wrote:
I don't understand the following.
a=np.zeros( (3,3,3), dtype='Complex128')
a array([[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]],
[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]],
[[0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j], [0.0+0.0j, 0.0+0.0j, 0.0+0.0j]]], dtype=complex256)
i ask for Complex128 and get complex256?
What platform? On Win-64 longdouble == double.
Of course, the byte-width names should still reflect the reality. Please file a bug ticket...
-- Pauli Virtanen
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
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) -- Pauli Virtanen
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)
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
np.array([0,0], dtype='complex128') array([ 0.+0.j, 0.+0.j]) np.array([0,0], dtype='complex128').dtype
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
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. dtype('complex128') dtype('complex128') dtype('complex128')
np.array([0,0], dtype=np.complex64) array([ 0.+0.j, 0.+0.j], dtype=complex64)
on Ubuntu 64 bit. Cheers, Scott
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
participants (3)
-
Pauli Virtanen
-
Ross Harder
-
Scott Sinclair