1.读取Excel
1.1 读取文件时转换指定列
import pandas as pd
pd.read_excel("data.xlsx", usecols=[0, 1, 3, 5], names=["姓名", "年龄", "手机号", "地址"],
converters={"手机号": str})
2. 写入Excel
2.1 写入多个Sheet
import pandas as pd
with pd.ExcelWriter("result.xlsx") as writer:
for df in dfs:
df.to_excel(writer, sheet_name=df["name"].unique()[0], index=False, encoding="utf8)