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()
相关推荐
没有医保李先生30 分钟前
字节对齐的总结
java·开发语言
Elastic 中国社区官方博客1 小时前
使用 Elastic 进行网络监控:统一网络可观测性
大数据·开发语言·网络·人工智能·elasticsearch·搜索引擎·全文检索
Codefengfeng1 小时前
Python Base环境中加包的方法
开发语言·python
清水白石0081 小时前
《Python 编程全景解析:从核心精要到测试替身(Test Doubles)五大武器的实战淬炼》
开发语言·python
如若1232 小时前
AutoDL云服务器 NVIDIA 570驱动 EGL渲染修复全记录
运维·服务器·python
甲枫叶2 小时前
【claude】Claude Code正式引入Git Worktree原生支持:Agent全面实现并行独立工作
java·人工智能·git·python·ai编程
六件套是我2 小时前
无法访问org.springframeword.beans.factory.annotation.Value
java·开发语言·spring boot
S-码农3 小时前
Linux ——条件变量
linux·开发语言
清水白石0083 小时前
《Python 编程全景解析:从核心精要到 Hypothesis 属性基测试的边界探索》
开发语言·python