[Numpy-discussion] (arange(2, typecode=Complex) % 2).typecode()

Jean-Bernard Addor jbaddor at physics.mcgill.ca
Fri Jun 2 12:30:17 EDT 2000


Hey again!

Why is (arange(2, typecode=Complex) % 2).typecode() object and not
complex?

Jean-Bernard

Python 1.5.1 (#1, Dec 17 1998, 20:58:15)  [GCC 2.7.2.3] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
Hello from .pythonrc.py
>>> from Numeric import *
>>> (arange(2, typecode=Complex) % 2).typecode()
'O'
>>> arange(2, typecode=Complex) % 2
array([0j , (1+0j) ],'O')
>>> arange(2) % 2
array([0, 1])

I have the same result python 1.5.2 and Numeric 11.





More information about the NumPy-Discussion mailing list