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')
posted @ 2022-05-02 10:04  kuanleung  阅读(10)  评论(0)    收藏  举报  来源