scipy.maxentropy.logsumexp

scipy.maxentropy.logsumexp(a)
Compute the log of the sum of exponentials log(e^{a_1}+...e^{a_n}) of the components of the array a, avoiding numerical overflow.