我通过以下方式创建了一个空的数据框:
df_test = pd.DataFrame(columns=temp_column_names)
我想将数据添加到它的后面:
def remove_milestones_before_scope(df, audit, milestone, milestonetype):
df = df[(df['Audit'] == audit) & (df['Milestone'] == milestone) & (df['MilestoneType'] == milestonetype)]
df = df.reset_index(drop=True)
count = len(df.index)
if count >= 2:
for index, item in islice(df.iterrows(), None, count-1):
if item[3] <= item[7]:
df.drop(index, inplace=True)
else:
print(df)
df_test.append(df) <- NOT APPENDING
else:
None
为什么我的数据框未附加到df_test?
答案 0 :(得分:0)
我认为您应该尝试:
df_test = df_test.append(df)