0
可以在this link找到该文本文件。我感兴趣的是体育评分的价值。以图形方式,它出现在Feature2 sys列下。处理文本文件以查找高于PE分数阈值3.19的值
这是我的代码:
def main():
file = open ("combined_scores.txt" , "r")
lines = file.readlines()
file.close()
count_pe=0
for line in lines:
line=line.strip()
line=line[24:31] #1problem is here:the range is not fixed in all line of the file
if line.find("3.19") != -1 : # I need value >=3.19 not only 3.19
count_pe = count_pe + 1
print (">=3.19: ", count_pe)#at the end i need how many times PE>3,19 occur
main()
无限谢谢:) –