[SciPy-user] Finding complex roots of complex polynomials in newscipy

Robert Kern rkern at ucsd.edu
Sun Nov 13 02:03:57 CST 2005


Fernando Perez wrote:

> I tracked this down to the following behavior in the scipy type hierarchy. 
> This looks to me like a bug, unless I'm missing something:
> 
> In [14]: zarr = scipy.array([1j,2j])
> 
> In [15]: zarr.dtype
> Out[15]: <type 'complex128_arrtype'>
> 
> In [16]: isinstance(zarr.dtype,scipy.complexfloating)
> Out[16]: False

You tested the wrong predicate, I think.

In [66]: issubclass(zarr.dtype, complexfloating)
Out[66]: True

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter



More information about the SciPy-user mailing list