Q:

Linear fit with curve_fit

I'm trying to make a linear fit, but I have two problems. First, it tells me 
that the "covariance of the parameters could not be estimated", even though my guess for the parameters should be right. I also obtain the following error: "'numpy.float64' object cannot be interpreted as an integer". I think that the last error means that I'm using a float number where I would need an integer, but I can't understand where the error is. Thanks for any help you can provide!
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np  
from scipy.optimize import curve_fit   

E1=[13.95,17.74]
CH=[880.89,1122.28]
errCH=[0.10,0.21]
errE1=[0.0,0.0]

def cal_func(x,c,m):
    return m*x+c
from scipy.optimize import curve_fit
popt, pcov=curve_fit(cal_func,E1,CH,p0=[-10,60])

plt.plot(E1,cal_func(E1,*popt))
plt.errorbar(E1,CH,errCH,errE1,linestyle="none")
plt.xlabel("Energy [KeV]")
plt.ylabel("Bin")

A:

This will fix the "float64" error:
E1=np.array([13.95,17.74])
CH=np.array([880.89,1122.28])
errCH=np.array([0.10,0.21])
errE1=np.array([0.0,0.0])

