写
from pandas import DataFrame import collections # 有序字典 data = collections.OrderedDict({ '姓名': ['张三', '李四', '王五'], '年龄': [11, 12, 13], '性别': ['男', '女', '男'], }) df = DataFrame(data) df.to_excel('new1.xlsx')
读
import pandas as pd df = pd.read_excel(r'stu.xlsx') print(df.head())