[Numpy-discussion] Assigning complex value to real array

josef.pktd@gmai... josef.pktd@gmai...
Thu Oct 7 14:45:34 CDT 2010


On Thu, Oct 7, 2010 at 3:38 PM, Andrew P. Mullhaupt
<doc@zen-pharaohs.com> wrote:
>  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 this will simply not be done, since there seems to be little
>> need for such a feature
>
> No, there is a big need to get the feature in sooner rather than later.
> By having this behavior, Python is filtering out a lot of potential
> users. So you will not get a lot of complaints - because people will
> just walk away and use Matlab, Scilab, or R, etc. Given this behavior
> one is strongly tempted to declare everything complex and deprecate the
> reals. Unfortunately that is going to run afoul of some things in
> subsidiary libraries.
>
> This idea of "need". What does log(int(2)) return? I guess someone
> "needed" that one. But not log(int(-2)). Well, who needs physics and
> electrical engineering.

what's your namespace?

>>> from scipy import log
>>> log(int(-2))
(0.69314718055994529+3.1415926535897931j)

Josef

> I agree it will not be done, but mainly because people who are in a
> position to do it will find an excuse to not do it, not for any better
> reason. But it is important to inform everyone that it is not for lack
> of a better alternative that we have this problem. It is for lack of
> effort. Let's just fess up about why it's not going to be done.
>
> Best regards,
> Andrew Mullhaupt
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the NumPy-Discussion mailing list