[Numpy-discussion] numpy.asum ?
Mon Oct 5 14:55:01 CDT 2009
On Mon, Oct 5, 2009 at 8:43 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Mon, Oct 5, 2009 at 13:37, Sebastian Haase <email@example.com> wrote:
>> Thanks for the reply.
>> I thought one reason for amax was that
>> from numpy import *
>> would not not import max but only amax.
> I have my timelines confused. Numeric has neither amax() nor max(). I
> don't actually recall the sequence of events, then.
>> How about sum ?
>> Does "from numpy import *"
>> overwrite the builtin sum ?
> Try it.
<built-in function sum>
>>> from numpy import *
<function sum at 0x0334E2B0>
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'asum' is not defined
>> not to mention the "symmetry" / consistency argument for having "asum" ?
> At this point, I don't care to cater to "from numpy import *" use
> case. Too much code uses numpy.sum() remove it, or even deprecate it.
I did not mean to suggest to remove or deprecate it. I only remember
that there was a discussion - long time ago - that "from numpy import
*" (still common in many places, like interactive sessions) - should
not overwrite builtins ....
Personally, I would prefer to write np.amax and np.asum ... do you see
my argument for consistency here ?
More information about the NumPy-Discussion