a=np.random.choice(10,(3,4)) b=np.random.choice((100,500),(3,4)) df1=pd.DataFrame(a,columns=["x1","x2","x3","x4"],index=["a","b","c"]) df2=pd.DataFrame(b,columns=["x1","x2","x3","x4"],index=["b","c","d"]) print(pd.concat([df1,df2],ignore_index=False))
# ignore_index=True todo index default: 0,1,2,.....
![](https://img2020.cnblogs.com/i-beta/1633019/202003/1633019-20200310202917821-1474287699.png)
# ignore_index False a,b,c,b,c,d
![](https://img2020.cnblogs.com/i-beta/1633019/202003/1633019-20200310203003451-776441655.png)