[Numpy-svn] r3749 - trunk/numpy/lib
numpy-svn at scipy.org
numpy-svn at scipy.org
Fri May 11 18:35:32 EDT 2007
Author: oliphant
Date: 2007-05-11 17:35:26 -0500 (Fri, 11 May 2007)
New Revision: 3749
Modified:
trunk/numpy/lib/function_base.py
Log:
Fix nan functions to allow sub-class.
Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py 2007-05-11 21:49:03 UTC (rev 3748)
+++ trunk/numpy/lib/function_base.py 2007-05-11 22:35:26 UTC (rev 3749)
@@ -730,7 +730,7 @@
def nansum(a, axis=None):
"""Sum the array over the given axis, treating NaNs as 0.
"""
- y = array(a)
+ y = array(a,subok=True)
if not issubclass(y.dtype.type, _nx.integer):
y[isnan(a)] = 0
return y.sum(axis)
@@ -738,7 +738,7 @@
def nanmin(a, axis=None):
"""Find the minimium over the given axis, ignoring NaNs.
"""
- y = array(a)
+ y = array(a,subok=True)
if not issubclass(y.dtype.type, _nx.integer):
y[isnan(a)] = _nx.inf
return y.min(axis)
@@ -746,7 +746,7 @@
def nanargmin(a, axis=None):
"""Find the indices of the minimium over the given axis ignoring NaNs.
"""
- y = array(a)
+ y = array(a, subok=True)
if not issubclass(y.dtype.type, _nx.integer):
y[isnan(a)] = _nx.inf
return y.argmin(axis)
@@ -754,7 +754,7 @@
def nanmax(a, axis=None):
"""Find the maximum over the given axis ignoring NaNs.
"""
- y = array(a)
+ y = array(a, subok=True)
if not issubclass(y.dtype.type, _nx.integer):
y[isnan(a)] = -_nx.inf
return y.max(axis)
@@ -762,7 +762,7 @@
def nanargmax(a, axis=None):
"""Find the maximum over the given axis ignoring NaNs.
"""
- y = array(a)
+ y = array(a,subok=True)
if not issubclass(y.dtype.type, _nx.integer):
y[isnan(a)] = -_nx.inf
return y.argmax(axis)
More information about the Numpy-svn
mailing list