【发布时间】:2019-11-12 20:29:09
【问题描述】:
我的数据框看起来像这样
A B C
1 2 3
4 5 6
我想在 forloop 中向我的数据框添加新行(不循环现有数据框)
for item in queryset:
if item == 'foo':
#append new row, with only column 'b' with value
df.append({'b' : item} , ignore_index=True)
但是这种方法行不通。如何向现有数据框添加新行?
【问题讨论】: