summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_nanfunctions.py
Commit message (Collapse)AuthorAgeFilesLines
...
* BUG: Refactor nanfunctions to behave as agreed on for 1.9.Charles Harris2013-10-041-66/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* STY: Make numpy/lib/test/*.py PEP8 compliant.Charles Harris2013-09-031-14/+14
| | | | | | | Run autopep8 over the test files in numpy/lib/test and make fixes to the result. Also remove Python5 workaround.
* DEP: Make nansum return 0 for all-NaN or empty axis.Charles Harris2013-08-181-27/+11
| | | | | Make this happen and remove test parts dependent on numpy version < 1.9. Fixes test failures in numpy after 1.8 branch.
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-4/+4
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* DOC: Various fixes.Charles Harris2013-08-141-4/+4
| | | | | | Fix typos and clarify some explanations. Document the changes in the return values of nanargmin and nanargmax for all-NaN slices in the 1.8.0 release notes.
* TST: Add tests for the nansum, nanmean, nanvar, and nanstd.Charles Harris2013-08-121-190/+367
|
* MAINT: Separate nan functions into their own module.Charles Harris2013-08-121-0/+240
New files lib/nanfunctions.py and lib/tests/test_nanfunctions.py are added and both the previous and new nan functions and tests are moved into them. The existing nan functions moved from lib/function_base are: nansum, nanmin, nanmax, nanargmin, nanargmax The added nan functions moved from core/numeric are: nanmean, nanvar, nanstd