如何使用pandas Python连接两个不同的数据框

2024-05-17 08:21:01 发布

您现在位置:Python中文网/ 问答频道 /正文

第一个dataframe1只是三行的头(只有一行字符串)

我的工作分配 我们只在乡村有商店 我们从2017年9月16日开始工作了52周

第二个dataframe2是我的主要工作部分,标题如下

Item,item details,price,packcolor,flavour,total orders (in thousand),delivery time (in weeks)
1,Priceless chocklate biscuits,20,black,chocolate,16,3
2,Priceless chocklate biscuits,25,white,vanila,23,6
3,Priceless chocklate biscuits,20,orange,Orange,54,2

当我使用beow语句时:

df = pd.concat(dataframe1,dataframe2,axis=0)

它在excel的一列中显示结果,还删除了dataframe2的标题


Tags: 字符串in标题detailsitemprice商店乡村