用索引连接数据框

时间:2020-05-09 20:57:48

标签: python pandas indexing

我有df=[4,5,6]df2=[7,8,9],因为两个索引都是0,1,2

我使用了pd.concat([df,df1]),但结果却给了我0,1,2,0,1,2的索引。

我想要生成的df索引0,1,2,3,4,5

有帮助吗?

1 个答案:

答案 0 :(得分:5)

pd.concat([df,df2], ignore_index=True )

enter image description here