[Numpy-discussion] Assigning complex value to real array

Robert Kern robert.kern@gmail....
Thu Oct 7 19:21:03 CDT 2010

On Thu, Oct 7, 2010 at 18:46, Andrew P. Mullhaupt <doc@zen-pharaohs.com> wrote:
>  On 10/7/2010 5:14 PM, Pauli Virtanen wrote:
>> to, 2010-10-07 kello 15:38 -0400, Andrew P. Mullhaupt kirjoitti:
>> [clip]
>>> On 10/7/2010 1:01 PM, Pauli Virtanen wrote:
>>>> to, 2010-10-07 kello 12:08 -0400, Andrew P. Mullhaupt kirjoitti:
>>>> [clip]
>>>> But to implement this, you'd have to rewrite large parts of Numpy since
>>>> the separated storage of re/im conflicts with its memory model.
>>> You wouldn't want to rewrite any of Numpy, just add a new class.
>> I believe you didn't really think about this. Because of the memory
>> model mismatch, you will need to rewrite all arithmetic operations,
>> special functions, and any operations that select, choose, sort, etc.
>> parts of arrays.


> But let's go back to what I asked: Could we have a data type that would
> be able to widen itself?
> It appears that your answer is YES, we COULD have that, BUT it would be
> a lot of work.

You misread him. The answer is "no." We will not change the memory
model so incompatibly. There is not only too much code in numpy to
rewrite, but a ton of other code that we do not maintain that relies
on our current memory model.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the NumPy-Discussion mailing list