[pandas] df.append()之后数据为空/保存为空的解决方案

  • Post author:
  • Post category:其他


在这里插入图片描述

从文档中,我们可以推测出这并不是一个原地 操作,而是会返回一个新的DataFrame,

目测是通过类似拼接的方式实现的,所以正确的使用方法应该是:

            df_out=df_out.append({'err':err,'predicted':corrected_sent,'target':cor},
                          ignore_index=True)



版权声明:本文为ftimes原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。