我有這樣的代碼來定義一個函數爲什麼在定義函數後出現語法錯誤?
def f(Frequency,Omegahot,Beta,Omegacold,Thot,Tcold):
C=300000000
k=1.38E-23
h=6.062E-34
return(Omegahot*numpy.power(Frequency,Beta))*((2*h*numpy.power(Frequency,3)/(C**2)))*(1/(numpy.exp(h*Frequency/(k*Thot))-1)) + (Omegacold*numpy.power(Frequency,Beta)*((2*h*numpy.power(Frequency,3)/(C**2)))*(1/(numpy.exp(h*Frequency/(k*Tcold))-1))
xdata=[1,2,3,4,5]
popt, pcov = curve_fit(f,xdata,fluxs,p0=None,)
print popt
但我在該行擴展數據出現語法錯誤= [1,2,3,4,5]我在做什麼錯
[PEP-8建議限制一行到長79個字符。](http://www.python.org/dev/peps/pep-0008/#maximum-line-length),應考慮用一些臨時變量將你的大量方程分解成多行,以使它更易讀,並使這樣的錯誤更容易調試。 – 2013-03-19 17:47:00