import pandasas pd
import os
#install xlrd
#需要先安装xlrd
cur_dir = os.path.dirname(__file__)
xls_file = os.path.join(cur_dir,"students.xlsx")
ID_df = pd.read_excel(xls_file,sheet_name="ID")
Class_df = pd.read_excel(xls_file,sheet_name="Class")
School_df = pd.read_excel(xls_file,sheet_name="School")
School_df2 = pd.read_excel(xls_file,sheet_name="School2")
#print(ID_df)
#print(Class_df)
#print(School_df)
school_final = pd.concat([School_df, School_df2],ignore_index=True,sort=False)
print(school_final)
网友评论