Fitting a pandas dataframe to a Poisson Distribution
I think the cause of the error is the np.math.factorial(k) function call, since curve_fit passes a numpy array as the first parameter to the poisson function, and if you try to run the code

np.math.factorial(np.array([1, 2, 3]))


You'll get the error

TypeError: only size-1 arrays can be converted to Python scalars


Try using scipy.special.factorial since it accepts a numpy array as input instead of only accepting scalers.

Thus, just change your poisson function to 

def poisson(k, lamb):
    return (lamb**k/ scipy.special.factorial(k)) * np.exp(-lamb)


Hope this helps

EDIT:
Also I fixed the ^ to ** since that's how you use the exponential operator in python.