Question: Python jupyter notebook. CSC 2230 Computer Programming for Engineers. 10) Have the following files loaded in the same folder: www.py4e.com/code3/mbox-short.txt www.py4e.com/code3/mbox.txt and write a function

Python jupyter notebook. CSC 2230 Computer Programming for Engineers.

Python jupyter notebook. CSC 2230 Computer Programming for Engineers. 10) Have the

10) Have the following files loaded in the same folder: www.py4e.com/code3/mbox-short.txt www.py4e.com/code3/mbox.txt and write a function meanSpamconfidence that takes a filename as an input, then read through the file and look for the lines of the form: X-DSPAM-Confidence: 0.8475 When you encounter a line that starts with "X-DSPAM-Confidence:" pull apart the line to extract the floating-point number on the line (e.g., 0.8475). Count these lines and then compute the total of the spam confidence values from these lines. When you reach the end of the file, print out the average spam confidence (calculated by total/count) Example results may look like: meanSpamConfidence( 'mbox.txt') Prints Average spam confidence: 0.894128046745 meanSpamconfidence 'mbox-short.txt') - Prints Average spam confidence: 0.750718518519

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!