Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. filename = 'CCL-mbox-short.txt'
  2. line_count = 0
  3. total_confidence = 0
  4. with open(filename, 'r') as f:
  5. for line in f.readlines():
  6. if line.startswith('X-DSPAM-Confidence:'):
  7. float(line.lstrip('X-DSPAM-Confidence:'))
  8. line_count +=1
  9. total_confidence + float(line.lstrip('X-DSPAM-Confidence:'))
  10. print(total_confidence/line_count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement