Task 1: Write a program that creates a data frame called students that contains height in cm and weight in kg in descending order. if there are blanks i.e. NA fill them with 50.
Task 2: Find teh avaergae and maximum height and weight.
Task 3: Compute a liner fit for the data of the form a*x +b. Find a and b.
Task 4: Plot this data using 2D plot X-axis height and Y-axis weight. Use appropiate Xlimit nad Ylimit.
Task 5:Plot the linear fit line on the top of the graph in task 3.
Students | Height | Weight |
---|---|---|
Sam | 169 | 69 |
Tom | 167 | 65 |
Peter | 161 | 62 |
Pete | 157 | 61 |
Mark | 151 | 58 |
Sarah | 149 | 54 |
Susan | 146 | 52 |
Gary | 142 | 51 |
Fergus | 140 | 49 |
Harry | 141 | 45 |
Niamh | 136 | 41 |
Python Code
Task 1:
import pandas as pd import numpy as np students = {'Height(cm)': [169 , 167, 161 , 157 , 151 , 149 , 146 , 142 , 140 , 141 , 136], 'Student': ['Sam', 'Tom', 'Peter', 'Pete', 'Mark', 'Susan', 'Sarah', 'Gary', 'Fergus', 'Harry', 'Niamh'], 'Weight(kg)': [69 , 65 , 62 , 61 , 58 , 54 , 52 , 51, 49 , 45 , 41] } df = pd.DataFrame(students)
NEW YEAR OFFER 50% OFF !!! Order Now
NEW YEAR OFFER 50% OFF !!
Lets take Best opinion from our Expert Tutors Today! Order Now
*Disclaimer: The reference papers provided by QuickAssignmentHelp.net serve as model papers for students and not to be submitted as it is. These papers are intended to used for research and reference purposes only.
Copyright © 2024 QuickAssignmentHelp.net All right reserved.