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()
無限謝謝:) –