标签: python pandas indexing
我有df=[4,5,6]和df2=[7,8,9],因为两个索引都是0,1,2。
df=[4,5,6]
df2=[7,8,9]
0,1,2
我使用了pd.concat([df,df1]),但结果却给了我0,1,2,0,1,2的索引。
pd.concat([df,df1])
0,1,2,0,1,2
我想要生成的df索引0,1,2,3,4,5
0,1,2,3,4,5
有帮助吗?
答案 0 :(得分:5)
pd.concat([df,df2], ignore_index=True )