[Numpy-discussion] Deprecate np.max/np.min ?
josef.pktd@gmai...
josef.pktd@gmai...
Fri Nov 6 11:57:03 CST 2009
On Fri, Nov 6, 2009 at 12:40 PM, Charles R Harris
<charlesr.harris@gmail.com> wrote:
> People import these functions -- yes, they shouldn't do that -- and the
> python builtin versions are overloaded, causing hard to locate errors. It
> would be easy enough to put a small wrapper around the current definition in
> core/__init__.py and raise a deprecation warning. The round function might
> be another candidate for deprecation.
>
> Thoughts?
I like np.min, np.max (corresponding to min, max methods of arrays),
and I don't like the `a` in front of the names.
Users need to learn to get their namespaces correct, because there are
a lot of functions that have different meanings and syntax across
packages.
It follows the same pattern for missing brackets as many of the other
functions, where I often have typos.
>>> np.min(3,2)
3
>>> np.sum(3,2)
3
>>> np.ones(3,2)
Traceback (most recent call last):
File "C:\Programs\Python25\lib\site-packages\numpy\core\numeric.py",
line 1567, in ones
a = empty(shape, dtype, order)
TypeError: data type not understood
Josef
>
> Chuck
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
More information about the NumPy-Discussion
mailing list