def _extalg(xarr, alpha=100, axis=None):
    '''Given an array xarr of values, smoothly return the max/min'''
    return (np.sum(xarr * np.exp(alpha*xarr), axis=axis, keepdims=True)/
                np.sum(np.exp(alpha*xarr), axis=axis, keepdims=True))
Given an array xarr of values, smoothly return the max/min