hw04.pdf - hw04_master October 3, 2019 1 Homework 4:...

This preview shows page 1 - 3 out of 11 pages.

hw04_masterOctober 3, 20191Homework 4: Functions, Histograms, and GroupsReading:Visualizing Numerical DistributionsFunctions and TablesPlease complete this notebook by filling in the cells provided.Before you begin, execute thefollowing cell to load the provided tests. Each time you start your server, you will need to executethis cell again to load the tests.Homework 4 is due Thursday, 9/26 at 11:59pm. Start early so that you can come to office hours ifyou’re stuck. Check the website for the office hours schedule. You will receive an early submissionbonus point if you turn in your final submission by Wednesday, 9/25 at 11:59pm. Late work willnot be accepted as per thepoliciesof this course.Throughout this homework and all future ones, please be sure to not re-assign variables throughoutthe notebook! For example, if you usemax_temperaturein your answer to one question, do notreassign it later on.Moreover, please be sure to only put your written answers in the providedcells.[ ]:# Don't change this cell; just run it.importnumpyasnpfromdatascienceimport*# These lines do some fancy plotting magic.\n",importmatplotlib%matplotlibinlineimportmatplotlib.pyplotaspltplt.style.use('fivethirtyeight')fromclient.api.notebookimportNotebookok=Notebook('hw04.ok')Before continuing the assignment, select ”Save and Checkpoint” in the File menu and then executethe submit cell below. The result will contain a link that you can use to check that your assignmenthas been submitted successfully. If you submit more than once before the deadline, we will onlygrade your final submission. If you mistakenly submit the wrong one, you can head to okpy.org1
and flag the correct version. There will be another submit cell at the end of the assignment whenyou finish![ ]:_=ok.submit()1.11. Causes of Death by YearThis exercise is designed to give you practice using the Table methodpivot.Hereis a link to thePython reference page in case you need a quick refresher.Run the cell below to view a demo on how you can use pivot on a table.[4]:fromIPython.displayimportYouTubeVideoYouTubeVideo("4WzXo8eKLAg")[4]:We'll be looking at adatasetfrom the California Department of Public Healththat records the cause of death, as recorded on a death certificate, foreveryone who died in California from 1999 to 2013.The data is in the filecauses_of_death.csv.zip.Each row records the number of deaths by a specificcause in one year in one ZIP code.2

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 11 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Demography, Array, The Table

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture