Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DSC 4 3 0 : Python Programming Assignment 0 9 0 1 : Height Histograms Please download the file Heights _ and _ Weights.csv

DSC 430: Python Programming Assignment 0901: Height Histograms
Please download the file "Heights_and_Weights.csv" on the D2L.
Read the data using Pandas package as you learned in the last lesson. The data contains height (in centimeter) and weight (in kilogram) of 3,000 subjects together with the sex information of each person (downloaded from this Kaggle dataset, and gently pre-processed). In this assignment, we will use Matplotlib's histogram command to estimate and plot the approximate distribution of heights for male and female subjects in the same figure. You may choose your own binning strategy and their numbers (higher number of bins usually gives a smoother visualization), but make sure that the bars in both histograms are fully aligned, enabling an easier comparison-you can do this by plotting the histograms with the same set of bins. Label the axes, histograms and legends accordingly.
Acceptadie
unacceptavie
Compute the mean of male and female heights using NumPy package and plot a vertical line at the location of each mean value. Check whether these vertical lines are close to the mode of the histograms. As a final check, compute the area under the histograms and see if they sum to one when you set density=True.
Record a three-minute video in which you run the code. Then, present your code. Specifically, answer the following questions:
Show how you read the data and divided them into male and female groups.
Show how you made the histograms transparent to let them be visible at the same time.
Explain how you made sure the histogram bins are the same for both groups and that they cover the whole data.
Show how you computed the area under the histograms and whether they summed to one.
Submission: Submit a single .py file containing all the code to the D2L. Do not zip or archive the file. Your code must include comments at the top including your name, date, video link, and the honor statement, "I have not given or received any unauthorized assistance on this assignment." Each function must include a docstring and be commented appropriately.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions

Question

Prove Equation (5.22).

Answered: 1 week ago