Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filename = 'CCL-mbox-short.txt'
- line_count = 0
- total_confidence = 0
- with open(filename, 'r') as f:
- for line in f.readlines():
- if line.startswith('X-DSPAM-Confidence:'):
- float(line.lstrip('X-DSPAM-Confidence:'))
- line_count +=1
- total_confidence + float(line.lstrip('X-DSPAM-Confidence:'))
- print(total_confidence/line_count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement