怎么用python把第一张图excel的数据爬下来按第二张图的顺序排列输出为excel呢
没安装pandas库的要先安装
import pandas as pd
df = pd.read_excel("d:\\test.xlsx", header=None)
lst=[]
for i in range(len(df)):
t=df.loc[i].tolist()[0]
if type(t)!=float:
type(t)
lst.append(t.split(':')[1])
lst = [lst[i:i+5] for i in range(0,len(lst),5)]
head = ['账号','姓名','护照号码','考号','申请编号']
lst = [head]+lst
pd.DataFrame(lst).to_excel('d:\\done.xlsx',header=None,index=False)