Question
You are given a data file that includes people in various counties in the US who were affected by virus X. The individual responsible for
You are given a data file that includes people in various counties in the US who were affected by virus X. The individual responsible for data collection wasn't very familiar with the interface of the notepad and might have listed numbers from several counties on one line, instead of one on each line. Therefore, each line in the file will include the integers representing the number of affected people per country.
Your task is to write a program that reads the file, extract the number of affected people, compute /identify the following:
1. sample mean of the data;
2. minimum number of affected people;
3. maximum number of affected people;
4. total number of counties reported
The program should print the computed values along with the number of people in the sample along to the screen. Make sure that the printed output is labeled so that the user knows which values are which. The sample data file is named 'data.txt'. Note that we do not want you to use the built-in sum(), min(), or max() functions or numpy (or another package - including simple_ds.py) to compute the values - we want you to compute these yourself (in the code) using the algorithms previously developed in class and for homework. Use 3 decimal points of accuracy when printing the results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started