a,b = np.polyfit(I,U,1) plt.plot(I,U,'+') plt.plot(I,a*I+b) print a print b plt.show() 3.96131611437 0.11577534343