Python 如何为for循环内的数据帧赋值?

Python 如何为for循环内的数据帧赋值?,python,dataframe,for-loop,Python,Dataframe,For Loop,我需要根据for循环中的某些条件向创建的数据帧(Exmil_df,Schedule_df)中的行添加值,但是使用row,row1不会对数据帧产生影响。有人能帮忙吗 for label, row in Exmil_df.iterrows(): for label1, row1 in Schedule_df.iterrows(): row1['Allocation']=0 while (row1['Requir

我需要根据for循环中的某些条件向创建的数据帧(Exmil_df,Schedule_df)中的行添加值,但是使用row,row1不会对数据帧产生影响。有人能帮忙吗

for label, row in Exmil_df.iterrows():
        for label1, row1 in Schedule_df.iterrows():
            row1['Allocation']=0
            
            while (row1['Requirement']==row1['Allocation']):
                enddate =row['Exmill'] + timedelta(days=15) #leadtime is considered as 15
                if (row1['PCD']>= enddate):
                    row['Sea']=row['Qty']
                    row1['Allocation']=row['Qty']
                    row=row+1
                
                else:
                    row['Air']=row['Qty']
                    row1['Allocation']=row['Qty']
                    row=row+1