df =pandas.concat([df1,df2])
由于df1和df2有各自的索引,假设都是从0~N
此时df的索引就会有重复,如果不使用索引还好。
如果在后面不小心使用索引,此时需要重置索引。
否则可能报错,只是说数据大小超出内存限制,但是shape没问题,数据记录数多了很多。
1、可以考虑df.reset_index(drop=True,inplace=True)
2、pandas.concat([df1,df2], ignore_index=True)
ignore_index: If True, do not use the index values along the concatenation axis. The resulting axis will be labeled 0, ..., n - 1. This is useful if you are concatenating objects where the concatenation axis does not have meaningful indexing information. Note the index values on the other axes are still respected in the join.