summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-05-11 22:35:26 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-05-11 22:35:26 +0000
commit56aa233a535263f309be2086f451a648d462d518 (patch)
tree95d4ed7943f6adbd2612bb9fe7631ba6cbe18529 /numpy/lib/function_base.py
parentd8d0b7aa7766029abacf6658d76d3a9666b5c9e5 (diff)
downloadnumpy-56aa233a535263f309be2086f451a648d462d518.tar.gz
Fix nan functions to allow sub-class.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 2bec7c081..150523ca4 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -730,7 +730,7 @@ def place(arr, mask, vals):
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 nansum(a, axis=None):
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 nanmin(a, axis=None):
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 nanargmin(a, axis=None):
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 nanmax(a, axis=None):
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)