import re
from pathlib import Path
import pandas as pd
here = Path('/home/zero/桌面/xxxx')
for filename in here.rglob('*.xlsx'):
print(filename)
x = pd.ExcelFile(filename)
print(x.sheet_names) # 表格列表sheet名
df = x.parse('表格1')
# 获取列名
# print(df.columns)
# 获取指定列
# print(df['修改前韵律'])
# print(df['修改后韵律'])
# 多列数据处理
for line_before,line_corrected in zip(df['xxx'],df['xxx']):
print(line_before)
print(line_corrected)
# coding:utf-8
import pandas as pd
data = pd.read_excel('example.xlsx', sheet_name='Sheet1')
print data
关于有关pandas更详细的使用,可参照:
https://www.jianshu.com/p/4ff1d2b23ab3
https://blog.csdn.net/qq_34377830/article/details/81872568
https://blog.csdn.net/tongxinzhazha/article/details/78796952