[Numpy-svn] [numpy/numpy] 9c7e6e: BUG: Refactor nanfunctions to behave as agreed on ...
GitHub
noreply at github.com
Sat Oct 5 12:03:38 EDT 2013
Branch: refs/heads/master
Home: https://github.com/numpy/numpy
Commit: 9c7e6e30315ab4541775d9a78630e88423c752c1
https://github.com/numpy/numpy/commit/9c7e6e30315ab4541775d9a78630e88423c752c1
Author: Charles Harris <charlesr.harris at gmail.com>
Date: 2013-10-04 (Fri, 04 Oct 2013)
Changed paths:
M numpy/lib/nanfunctions.py
M numpy/lib/tests/test_nanfunctions.py
Log Message:
-----------
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
Commit: 2f77e1e6e6b91a9cd11c422342c69e8fd68ee803
https://github.com/numpy/numpy/commit/2f77e1e6e6b91a9cd11c422342c69e8fd68ee803
Author: Charles Harris <charlesr.harris at gmail.com>
Date: 2013-10-04 (Fri, 04 Oct 2013)
Changed paths:
M numpy/core/_methods.py
M numpy/core/tests/test_numeric.py
Log Message:
-----------
BUG: Make ndarray.{var, std} work for scalars.
Commit: 0cfa4ed4ee39aaa94e4059c6394a4ed75a8e3d6c
https://github.com/numpy/numpy/commit/0cfa4ed4ee39aaa94e4059c6394a4ed75a8e3d6c
Author: Charles Harris <charlesr.harris at gmail.com>
Date: 2013-10-05 (Sat, 05 Oct 2013)
Changed paths:
M numpy/core/_methods.py
M numpy/core/tests/test_numeric.py
M numpy/lib/nanfunctions.py
M numpy/lib/tests/test_nanfunctions.py
Log Message:
-----------
Merge pull request #3866 from charris/refactor-1.9-nanfunctions
Refactor 1.9 nanfunctions
Compare: https://github.com/numpy/numpy/compare/c2dc2cdb7353...0cfa4ed4ee39
More information about the Numpy-svn
mailing list