summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-10-04 13:49:33 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-10-04 16:07:38 -0600
commit9c7e6e30315ab4541775d9a78630e88423c752c1 (patch)
treeb6b4a74d215a577c65f3e1dbfb493beef9176df1 /numpy/lib/utils.py
parentf665c617065ba59b1c517b8dd44080c83dbfd5bd (diff)
downloadnumpy-9c7e6e30315ab4541775d9a78630e88423c752c1.tar.gz
BUG: Refactor nanfunctions to behave as agreed on for 1.9.
Deal with subclasses of ndarray, like pandas.Series and matrix. Subclasses may not define the new keyword keepdims or deal gracefully with ufuncs in all their forms. This is solved by throwing the problem onto the np.sum, np.any, etc. functions that have ugly hacks to deal with the problem. Settle handling of all-nan slices. nanmax, nanmin -- Raise warning, return NaN for slice. nanargmax, nanargmin -- Raise ValueError. nansum -- Return 0 for slice. nanmean, nanvar, nanstd -- Raise warning, return NaN for slice. Make NaN functions work for scalar arguments. This may seem silly, but it removes a check for special cases. Update tests Deal with new all-nan handling. Test with matrix class as example of subclass without keepdims. Test with scalar arguments. Fix nanvar issue reported in #3860. Closes #3860 #3850
Diffstat (limited to 'numpy/lib/utils.py')
0 files changed, 0 insertions, 0 deletions