FutureWarning: Deprecation of frame.append method in pandas
问题:pandas中DataFrame数据拼接报错)FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. df = df1.append(df2)
sample = known_associations.append(random_negative)
解决:
sample_df = pd.concat([known_associations, random_negative], ignore_index=True)
总结
sample_df = pd.concat([known_associations, random_negative], ignore_index=True)
#等价于
sample = known_associations.append(random_negative)
sample.reset_index(drop=True, inplace=True)