Question
Need help creating a code in python (python only please). Given a data file, find the max, min, and average values of columns. Also, create
Need help creating a code in python (python only please).
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.
Data is arranged in columns where each item of data is twelve columns wide (so it is easy to extract data items using slicing):
Name Height(m) Weight(kg)
Joe 1.82 72.57
Mary 1.60 63.50
Dion 1.90 90.71
Kayla 1.72 66.31
Jose 1.78 70.23
Sofia 1.63 65.12
Erik 1.98 92.21
Sara 1.57 65.77
I need help creating a code to 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. format string: "{:<12s}{:<12.2f}{:<12.2f}{:<12.2f}"
once this is completed, I need help writing that output above to a file.
Example Output should look like:
Name Height(m) Weight(kg) BMI
Joe 1.82 72.57 21.91
Mary 1.60 63.50 24.80
Dion 1.90 90.71 25.13
Kayla 1.72 66.31 22.41
Jose 1.78 70.23 22.17
Sofia 1.63 65.12 24.51
Erik 1.98 92.21 23.52
Sara 1.57 65.77 26.68
Average 1.75 73.30 23.89
Max 1.98 92.21 26.68
Min 1.57 63.50 21.91
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