I've made a PR for this. The commit message is

    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.

Note that 1.7 already raises a ValueError for nanarg{max, min} on account
of casting rules that don't allow nans to be cast to ints. This just makes
the same hold true for scalar returns.

If there are no objections, this will go into 1.9 as a starting point and
be backported to 1.8.

Chuck
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to