pd.concat用法
import pandas as pd
import os
import openpyxl
path = './2006城市年鉴.xlsx'
excel = openpyxl.load_workbook(path)
length = len(excel.sheetnames)
book_1 = pd.read_excel(path,sheet_name=0)
print(book_1)
for i in range(length):
book = pd.read_excel(path,sheet_name=i)
book_1 = pd.concat([book_1,book],axis = 1)
book_1.to_excel('汇总.xlsx')

浙公网安备 33010602011771号