Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help answering questions 3 to 9. using python please! jupyterhub.egr.msu.edu anthrokids su. HW-02 Anthr... numpy.loadtxt Part 2: Workin... Day-08 Pra-C... Day-08 Pre-c.. Day-07

I need help answering questions 3 to 9. using python please!

image text in transcribedimage text in transcribed

jupyterhub.egr.msu.edu anthrokids su. HW-02 Anthr... numpy.loadtxt Part 2: Workin... Day-08 Pra-C... Day-08 Pre-c.. Day-07 In-Cla.. Python print College of Engineering puting Sevim-jupter H 2 Anthropometry Potti. auto -Logout Control Panel Last Cho kont 13 minutes ago Fle Edit Vew Insert Ce Kemel Widgets Help Trustn Python 3 O Question 2: The first thing you're going to do is make sure you can load in the data using NumPy. There is a file on D2L called 'anthrokids subset.csv". Make sure that you download the file and move it to the same location on your computer as this Jupyter Notebook. The extension of this file (.csv) stands for comma-separated values' and is commonly used for datasets. It is basically just a text file where each row of this file is the measurement of a separate person in the data set. The columns are different measures on each person and are separated by commas. The 'anthrokids subset.csv' file contains 5 columns with the following contents: [Age (years), Weight (kg), Height (cm), Waist Circumference (cm), Head Circumference (cm)] NOTE: Original version of this assignment had incorrecty read that Head Circumference came before Waist Circumference (switched column 4 and 5) These data are a subset of the data acquired in the S PRODUCT SAFETY DESIGN, perfomed by the U.S. Consumer Product Safety Commission to design some of the original car seats for children. Your job is to read the data into your Jupter Notebook using NumPy, specifically using the loadtxt) function, which will load the data into a mult column NumPy array. Once you've read in the data, print the array to see a portion of the array on the screen. When you load in the data, you can either read the data in and store it in a single variable, or you can use the unpack argument to read the data into a separate variable for each column. As a reference, you may wish to review the examples at the bottom of the documentation page for the loadtxt() function: https:/docs.sclpy.org/doc numpy-1.15.0reference/generatedumpy.loadtxt.html. You can also review how we loaded in the Great Lakes water level data during class. In [2411 da La np. loadtxt[Open (" an Lhrokida 8ub8et.csv"), delimiter="," , 8kiprowa-1) = In [25] print (data) 4.326 17.6 103.949.850.61 4.476 23. 52 51.2 1 3.841 16.599.749.148.9 2.442 12.4 90.5 47.6 48. [ 4.188 18.4 100.755.149.9 1 [4.974 25.5124.457. 53.7 ] Question 3: Before analyzing data, It is always good to summarize a portion of the data to get a sense of the population represented in the data. Answer the following in complete sentences, using print) statements: How many separate children were measured in this data? What is the age of the youngest and oldest child in this dataset? Likewise, what is the height of the tallest child? (For example, "The youngest child is x years old") jupyterhub.egr.msu.edu nthrokids su HW-02 Anthr... numpy.loadtxt Part 2: Werkin... Day-08 Pra-C... Day-08 Pre-c.. Day-07 In-Cla.. Python print You ane College of Engineering puting Sevim-jupyter H 2 Anthropometry Potti. Last Cock int 12 minutes ago Logout Control Panel Fle Edit Vew Insert Ce Kemel Widgets Help Trustn Python 3 O Part 2: Making plots with Matplotlib (10 points) For this section, we'll practice making some plots using the matplotlib module. You may or may nat have seen some of these plotting commands before, when you come across something you don't understand, you should try consulting the matplotlib documentation first, which you can find here: You might also find it useful to look at the examples and the tutorials. Question 5: Plot a histogram of the ages of the children in this data set. Label the axes approprlately In [ ]: # Put your code here Question 6: Based on the histogram or other calculations, roughly what is the most common age in this dataset. (exact answer is not necessary). Put your answer here Question 7: Create two separate scatter plots containing welght versus age and the other height versus age (age is on thex-axis). Choose an approprlate marker size to help visualize the multitude of the points. (Label all the axes appropriately) In [ ]: ## Put your code here Question 8: Based on visual assessment of these graphs, does weight increase more rapidly or height more rapidly as a human ages. Explain your answer Put your answer here Question 9: Make a two-dimensional histogram using hist2d() of weight and height. This represents a "top-down" or "bird's-eye' view of the distribution of children for each weight and height. Use 60 bins and add a colorbar to the plot. Make sure both axes and the colorbar all have appropriate labels. "Frequency" ls good label cholce for the colorbar because the 2D histogram will indicate how often values fell into a particular (xyj bin. In [ ]: ## Put your code here If everything went as planned, you should see in this 2D histogram representation that it is more common far children to share similar heights and weights, jupyterhub.egr.msu.edu anthrokids su. HW-02 Anthr... numpy.loadtxt Part 2: Workin... Day-08 Pra-C... Day-08 Pre-c.. Day-07 In-Cla.. Python print College of Engineering puting Sevim-jupter H 2 Anthropometry Potti. auto -Logout Control Panel Last Cho kont 13 minutes ago Fle Edit Vew Insert Ce Kemel Widgets Help Trustn Python 3 O Question 2: The first thing you're going to do is make sure you can load in the data using NumPy. There is a file on D2L called 'anthrokids subset.csv". Make sure that you download the file and move it to the same location on your computer as this Jupyter Notebook. The extension of this file (.csv) stands for comma-separated values' and is commonly used for datasets. It is basically just a text file where each row of this file is the measurement of a separate person in the data set. The columns are different measures on each person and are separated by commas. The 'anthrokids subset.csv' file contains 5 columns with the following contents: [Age (years), Weight (kg), Height (cm), Waist Circumference (cm), Head Circumference (cm)] NOTE: Original version of this assignment had incorrecty read that Head Circumference came before Waist Circumference (switched column 4 and 5) These data are a subset of the data acquired in the S PRODUCT SAFETY DESIGN, perfomed by the U.S. Consumer Product Safety Commission to design some of the original car seats for children. Your job is to read the data into your Jupter Notebook using NumPy, specifically using the loadtxt) function, which will load the data into a mult column NumPy array. Once you've read in the data, print the array to see a portion of the array on the screen. When you load in the data, you can either read the data in and store it in a single variable, or you can use the unpack argument to read the data into a separate variable for each column. As a reference, you may wish to review the examples at the bottom of the documentation page for the loadtxt() function: https:/docs.sclpy.org/doc numpy-1.15.0reference/generatedumpy.loadtxt.html. You can also review how we loaded in the Great Lakes water level data during class. In [2411 da La np. loadtxt[Open (" an Lhrokida 8ub8et.csv"), delimiter="," , 8kiprowa-1) = In [25] print (data) 4.326 17.6 103.949.850.61 4.476 23. 52 51.2 1 3.841 16.599.749.148.9 2.442 12.4 90.5 47.6 48. [ 4.188 18.4 100.755.149.9 1 [4.974 25.5124.457. 53.7 ] Question 3: Before analyzing data, It is always good to summarize a portion of the data to get a sense of the population represented in the data. Answer the following in complete sentences, using print) statements: How many separate children were measured in this data? What is the age of the youngest and oldest child in this dataset? Likewise, what is the height of the tallest child? (For example, "The youngest child is x years old") jupyterhub.egr.msu.edu nthrokids su HW-02 Anthr... numpy.loadtxt Part 2: Werkin... Day-08 Pra-C... Day-08 Pre-c.. Day-07 In-Cla.. Python print You ane College of Engineering puting Sevim-jupyter H 2 Anthropometry Potti. Last Cock int 12 minutes ago Logout Control Panel Fle Edit Vew Insert Ce Kemel Widgets Help Trustn Python 3 O Part 2: Making plots with Matplotlib (10 points) For this section, we'll practice making some plots using the matplotlib module. You may or may nat have seen some of these plotting commands before, when you come across something you don't understand, you should try consulting the matplotlib documentation first, which you can find here: You might also find it useful to look at the examples and the tutorials. Question 5: Plot a histogram of the ages of the children in this data set. Label the axes approprlately In [ ]: # Put your code here Question 6: Based on the histogram or other calculations, roughly what is the most common age in this dataset. (exact answer is not necessary). Put your answer here Question 7: Create two separate scatter plots containing welght versus age and the other height versus age (age is on thex-axis). Choose an approprlate marker size to help visualize the multitude of the points. (Label all the axes appropriately) In [ ]: ## Put your code here Question 8: Based on visual assessment of these graphs, does weight increase more rapidly or height more rapidly as a human ages. Explain your answer Put your answer here Question 9: Make a two-dimensional histogram using hist2d() of weight and height. This represents a "top-down" or "bird's-eye' view of the distribution of children for each weight and height. Use 60 bins and add a colorbar to the plot. Make sure both axes and the colorbar all have appropriate labels. "Frequency" ls good label cholce for the colorbar because the 2D histogram will indicate how often values fell into a particular (xyj bin. In [ ]: ## Put your code here If everything went as planned, you should see in this 2D histogram representation that it is more common far children to share similar heights and weights

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions