Python合并多Excel文件

Python合并多Excel文件

具体方法

下载安装好pandas并import pandas as pd

代码如下


复制代码
import  pandas as pd
file1='C:/e1.xlsx'
file2='C:/e2.xlsx'
file3='C:/e3.xlsx'
file=[file1,file2,file3]
li=[]
for i in file:
    li.append(pd.read_excel(i))
writer = pd.ExcelWriter('C:/output.xlsx')
pd.concat(li).to_excel(writer,'Sheet1',index=False)
 
writer.save()
相关推荐
深蓝电商API10 分钟前
Scrapy管道Pipeline深度解析:多方式数据持久化
爬虫·python·scrapy
噎住佩奇25 分钟前
(Win11系统)搭建Python爬虫环境
爬虫·python
basketball61630 分钟前
python 的对象序列化
开发语言·python
fie88891 小时前
钢结构件制造车间生产调度实例:MATLAB实现(基于遗传算法)
开发语言·matlab·制造
沐知全栈开发1 小时前
PHP 安装指南
开发语言
rgeshfgreh1 小时前
Python流程控制:从条件到循环实战
前端·数据库·python
luoluoal1 小时前
基于python大数据的电影市场预测分析(源码+文档)
python·mysql·django·毕业设计·源码
幻云20101 小时前
Python深度学习:从入门到实战
人工智能·python
Highcharts.js1 小时前
Highcharts Grid 表格/网格安装 |官方安装文档说明
开发语言·javascript·表格组件·highcharts·官方文档·安装说明·网格组件
Zoey的笔记本2 小时前
敏捷与稳定并行:Scrum看板+BPM工具选型指南
大数据·前端·数据库·python·低代码