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()
相关推荐
2401_8384725112 小时前
C++图形编程(OpenGL)
开发语言·c++·算法
boss-dog12 小时前
关于强化学习入门理解和示例
python·强化学习
一只理智恩12 小时前
筹备计划·江湖邀请令!!!
python·langchain
Sagittarius_A*12 小时前
角点检测:Harris 与 Shi-Tomasi原理拆解【计算机视觉】
图像处理·人工智能·python·opencv·计算机视觉
进击的小头12 小时前
陷波器实现(针对性滤除特定频率噪声)
c语言·python·算法
LitchiCheng12 小时前
Mujoco 开源机械臂 RL 强化学习避障、绕障
人工智能·python·开源
A先生的AI之旅13 小时前
2026-1-30 LingBot-VA解读
人工智能·pytorch·python·深度学习·神经网络
丝瓜蛋汤13 小时前
微调生成特定写作风格助手
人工智能·python
-To be number.wan13 小时前
Python数据分析:Matplotlib 绘图练习
python·数据分析·matplotlib
naruto_lnq13 小时前
Python生成器(Generator)与Yield关键字:惰性求值之美
jvm·数据库·python