def dingle_plot(file,T):
#make an array of the fields you want to have
#invB=[]
sdhx, main_sig=eff(file)
rho_0=main_sig[sdhx.index(min(sdhx, key=lambda x:abs(x-0.)))]
maxx, maxy, minx, miny=maxmin(sdhx, main_sig)
maxfitx, maxfity=fit(maxx,maxy, 0.3,1.001, 0.001)
minfitx, minfity=fit(minx,miny, 0.3,1.001, 0.001)
delta_rho_rho_0=[]
delta_rho_rho_0=dingle_dif(maxfitx, maxfity, minfitx, minfity,sdhx,delta_rho_rho_0)/rho_0
sdhx=np.array(sdhx)
invB= 1./sdhx
print invB
etha=(2*(np.pi)**2*kb*T*effm)/(hbar*e)
y= delta_rho_rho_0*(np.sinh(etha)/etha)
pylab.plot(invB,y)
当我调用此函数时,它会出错:
File "C:/Users/crosshat/Documents/SiGe/Sample Thomas/effective mass.py", line 228, in <module>
dingle_plot(c,0.648)
File "C:/Users/crosshat/Documents/SiGe/Sample Thomas/effective mass.py", line 210, in dingle_plot
etha=(2*(np.pi)**2*kb*T*effm)/(hbar*e)
TypeError: unsupported operand type(s) for *: 'float' and 'file'
这里有什么错误?