即使类型转换后我也无法弄清楚哪里出问题了,但我得到了相同的errorTypeError:'int'对象不可下标

我正在尝试绘制等压线族的抛物线。

我已经尝试过类型转换,并且我可能会做的一切

将matplotlib.pyplot导入为plt

name = [“ Xe”,“ Cs”,“ Ba”,“ Ce”]

A = [134,134,134]

Z = [54,55,56,58]

M1 = []

i = 0

而我

分配所有变量

if (A%2)==0 and (Z%2)==0:
    delP= -(aP/(A**(1/2)))

elif (A%2)!=0 and (Z%2)!=0:
        delP= aP/(A**(1/2))
else:
            delP=0
            M=(gam*(Z**2)) - bet*(Z) + alp*A +delP


            M1[i]=int(M)
            i+=1    

plt.Zlabel(Z)

plt.M1label(M)

plt.title(“测试图”)

plt.rcParams [“ figure.figsize”] =(8,8)

fig,ax = plt.subplots() ax.plot(Z,M);

tttttt001 回答:即使类型转换后我也无法弄清楚哪里出问题了,但我得到了相同的errorTypeError:'int'对象不可下标

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3126576.html

大家都在问