Python Data Visualisation Program

Questions

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.

StudentsHeightWeight
Sam16969
Tom16765
Peter16162
Pete15761
Mark15158
Sarah14954
Susan14652
Gary14251
Fergus14049
Harry14145
Niamh13641
Solution:

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)

To Get Solution

Please put your valid email id

Plagiarism Checker

NEW YEAR OFFER 50% OFF !!! Order Now

NEW YEAR OFFER 50% OFF !!

Lets take Best opinion from our Expert Tutors Today! Order Now