[SciPy-dev] about numpy.max() and numpy.min() - isn't it a bug?
Alan G Isaac
aisaac at american.edu
Tue Aug 14 13:09:17 EDT 2007
On Tue, 14 Aug 2007, Dmitrey Kroshko apparently wrote:
> I use the min and max from numpy (from numpy import *)
No, Darren is giving you the answer. See below.
There are two problems.
One problem is that numpy.max exists for historical reason.
Another problem is that numpy.max is not import when you use import *.
As the saying goes:
"That hurts!"
"So don't do it!"
I.e., adopt practices that ensure you know the namespace you
are using.
Cheers,
Alan Isaac
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310
32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> from numpy import *
>>> help(numpy.max)
Help on function amax in module numpy.core.fromnumeric:
amax(a, axis=None, out=None)
Return the maximum of 'a' along dimension axis.
>>> help(max)
Help on built-in function max in module __builtin__:
max(...)
max(iterable[, key=func]) -> value
max(a, b, c, ...[, key=func]) -> value
With a single iterable argument, return its largest item.
With two or more arguments, return the largest argument.
>>>
More information about the SciPy-Dev
mailing list