subject

Given a data file, find the max, min, and average values of columns. Also, create an addition column that is based on the other columns. There will be no error checking required for this lab. You are provided with a data file named (surprise!) data .txt. Data is arranged in columns where each item of data is twelve columns wide (so it is easy to extract data items using slicing)
Your task is read the file data. txt and calculate the max, min, and average of the height and weight columns and to add an additional column that has the BMI calculated based on each height and weight. Your output will look like this (and needs to be formatted like this). To match the testing on Mirmir here is the format string:
The formula for BMI is simple in the metric system:BMI = weight/height ** 2
How do we find the max and min?
The basic concept is similar to counting that you have done multiple times:initialize a value before a loop and the update the value every time through the loop.
Based on that concept here is the algorithm to find the minimum of a set of values:
1. Initialize minimum to be much larger than any data value in your data, e. g. 10**6.
2. When you consider each data item, if the data item is smaller than the current minimum, you have a new minimum (so update it).
3. After considering all data items your minimum will contain the smallest.
The algorithm to find the maximum is a tiny variation.
To find the average, add up all the values and count how many values there are. Divide those two to get the average.
1. Begin by simply opening the file and printing every line - now you know that you are correctly working with the correct file.
2. Next ignore the header line-use either readline () before the loop or continue in the loop.
3. Next find the average of a column:collect a total and count, remembering to initialize before the loop.
4. Next find the minimum of a column using the algorithm above.
5. Continue in such small increments to do the remainder of the program.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:50
Write a 3-4 page apa formatted paper comparing your organization’s it strategy with the best practices outlined in your course text. content should include, but not be limited to: developing and delivering on the it value, developing it strategy for the business value and linking it to business metrics. your paper should include an abstract and a conclusion and a reference page with 3-5 references
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
question
Computers and Technology, 22.06.2019 23:00
Which factor is the most important when choosing a website host? whether customers will make secure transactions the number of email accounts provided the purpose of the website the quality of the host control panel
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
You know the right answer?
Given a data file, find the max, min, and average values of columns. Also, create an addition column...
Questions
question
History, 18.10.2019 12:30
Questions on the website: 13722367