np.logaddexp.accumulate
. Например:
>>> np.logaddexp.accumulate(np.arange(7))
array([0. , 1.31326169, 2.40760596, 3.4401897 , 4.4519144 ,
5.45619332, 6.45776285])
# verify:
>>> np.exp(_)
array([ 1. , 3.71828183, 11.10733793, 31.19287485,
85.79102488, 234.20418399, 637.63297748])
>>> np.diff(_)
array([ 2.71828183, 7.3890561 , 20.08553692, 54.59815003,
148.4131591 , 403.42879349])
>>> np.log(_)
array([1., 2., 3., 4., 5., 6.])