类型错误:'int' 对象在 while 循环中不可下标

时间:2021-05-10 13:56:22

标签: python dataframe while-loop

我在下面开发了while循环,需要在数据框中打印一个元素

row=0
row1=0
while row < len(Exmil_df):
    while row1 < len(Schedule_df):
        print(row1['Qty'])
        row1['Allocation']=0
        row['left_qty']=row['Qty']

我收到此错误。

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-30-93e354c324e6> in <module>
      3 while row < len(Exmil_df):
      4     while row1 < len(Schedule_df):
----> 5         print(row1['Qty'])
      6         row1['Allocation']=0
      7         row['left_qty']=row['Qty']

TypeError: 'int' object is not subscriptable

0 个答案:

没有答案