import pandas as pd
file=pd.read_excel(r"贵阳房价.xls",sheet_name="贵阳房价")
menu=file.iloc[:,1].drop_duplicates()for name in menu:
df=file[file.类型==name]
path="D:\\Pycharmpojo\\pojo\\自动化\\"+name+".xls"
df.to_excel(path,index=None)print("分表成功")
利用python对excel文件分表import pandas as pdfile=pd.read_excel(r"贵阳房价.xls",sheet_name="贵阳房价")menu=file.iloc[:,1].drop_duplicates()for name in menu: df=file[file.类型==name] path="D:\\Pycharmpojo\\pojo\\自动化\\"+name+".xls" df.to_excel(path,index=None