赞
踩
- #-*-coding:utf-8-*-
- import pandas as pd
- list=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L']
- word_list=[]
- for i in range(0,len(list)):
- for j in range(0,len(list)):
- word_list.append([list[i],list[j]])
-
- data={}
- for k in range(0,10):
- with open(str(k)+"_keywords.txt",'r',encoding='utf-8',errors='ignore') as f:
- txt_list=f.read().strip().split("\n")
- for line in txt_list:
- for l in word_list:
- if l[0] in line and l[1]in line:
- key=str(l[0])+';'+str(l[1])+';'
- if key in data.keys():
- data[key]=data[key]+1
- else:
- data.update({key:1})
- print(str(k)+' 完成')
- dat
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。