我有两个具有相同列标题的数据框。
我正在遍历df1中的行,分割其中一个列,然后使用这些分割列创建多个行以添加到另一个数据框中。
我正在遍历df1中的行,分割其中一个列,然后使用这些分割列创建多个行以添加到另一个数据框中。
for index, row in df1.iterrows():
curr_awards = row['AWARD'].split(" ")
for award in curr_awards:
new_line = row
new_line['AWARD'] = award.strip()
#insert code here to add new_line to df2
如何使用Pandas方法向另一个数据框添加行?