N = np.arange(proc+1)
np.sum(np.power(R, N) / (math.factorial(N)))
TypeError: only size-1 arrays can be converted to Python scalars
>>> import numpy as np
>>> np.math.factorial(np.arange(6))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: only size-1 arrays can be converted to Python scalars
>>> factorial = np.vectorize(np.math.factorial)
>>> factorial(np.arange(6))
array([ 1, 1, 2, 6, 24, 120])