[Numpy-discussion] add .H attribute?

Pauli Virtanen pav at iki.fi
Tue Jul 23 11:02:13 EDT 2013

23.07.2013 17:51, Nathaniel Smith kirjoitti:
[clip: conjcomplex dtype]
> Because this latter cast is safe, all the existing ufuncs would
> automatically work fine on conjcomplex arrays. But we could also
> define conjcomplex-specific ufunc loops for cases like dot() where a
> more efficient implementation is possible (using the above-mentioned
> BLAS flags).
> Don't know if we want to actually do this, but it's doable.

There's somewhat a lot of 3rd party code that doesn't do automatic 
casting (e.g. all of Cython code interfacing with Numpy, C extensions, 
f2py I think), but rather fails for incompatible input dtypes. Having 
arrays with a new complex dtype around would require changes in this 
sort of code.

In this sense having an iterator of some sort with an __array__ 
attribute would work. However, an iterator doesn't support (without a 
lot of work) the various ndarray attributes which would be confusing.

Pauli Virtanen

More information about the NumPy-Discussion mailing list