mergepython
时间: 2023-10-28 18:01:03 浏览: 10
在Python中,merge函数可以用于合并两个DataFrame。通过指定on参数来指明以哪个列作为键进行匹配。同时,还可以使用how参数来指定合并方式,比如left、right、inner、outer等。其中,left表示以第一个DataFrame为主进行合并。
在日常业务中,如果遇到需要合并数据的场景,可以尝试使用merge函数。此外,还可以结合使用loc切片和pivot、pivot_table透视表等函数来对数据进行更加丰富的清洗操作。
另外,如果需要读取Excel文件作为DataFrame,可以使用pandas库的read_excel函数,如df02 = pd.read_excel("./datas/new_software_InputSheet.xlsx")。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)