On Fri, Jul 20, 2012 at 1:17 PM, OC <[email protected]> wrote:

>> numpy.complex is just a reference to the built in complex, so only works
>> on scalars:

> What is the use of storing the "complex()" built-in function in the
> numpy namespace, when it is already accessible from everywhere?

for consitancy with teh rest of the numpy types. When I create a numpy
array, I might do:

np.zeros( (3,4), dtype=np.float32 )

so for the numpy types that have a direct relationship with the python
types, we put the type in the numpy namespace as well. But, since in
numpy, you generally really want to control your types closely, I"d
tend to use:

np.zeros( (3,4), dtype=np.complex128 ) (or np.complex64) anyway.

-Chris



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to