Midterm Assignment for Introductory Coding Class
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# STOR 120: Take Home Midterm 1\n", "\n", "**Due:** Friday, September 17, 9:05 am on Gradescope\n", " \n", "**Directions:** The exam is open book, notes, course materials, internet, and all things that are not direct communication with others. Just as with all course assignments, you will submit exams to Gradescope as Jupyter Notebooks with the ipynb file extension. To receive full credit, you should show all of your code used to answer each question." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Data:** The dataset used on this exam contains information on the number of students that majored in different topics of study at universities in the United States in 2019 and is broken down by age group, sex, and state. The original source of the data is the US Census Bureau, but this dataset was found on [Kaggle.com](https://www.kaggle.com/tjkyner/bachelor-degree-majors-by-age-sex-and-state)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Run the cell below to import the dataset.**" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
State |
Sex |
Age Group |
Bachelor's Degree Holders |
Science and Engineering |
Science and Engineering Related Fields |
Business |
Education |
Arts, Humanities and Others |
---|
Alabama |
Total |
25 and older |
885,357
|
263,555
|
98,445
|
210,147
|
141,071
|
172,139
|
Alabama |
Total |
25 to 39
|
268,924
|
90,736
|
32,378
|
58,515
|
29,342
|
57,953
|
Alabama |
Total |
40 to 64
|
418,480
|
115,762
|
46,724
|
112,271
|
63,875
|
79,848
|
Alabama |
Total |
65 and older |
197,953
|
57,057
|
19,343
|
39,361
|
47,854
|
34,338
|
Alabama |
Male
|
25 and older |
405,618
|
159,366
|
26,004
|
113,909
|
29,490
|
76,849
|
" ], "text/plain": [ "State | Sex | Age Group | Bachelor's Degree Holders | Science and Engineering | Science and Engineering Related Fields | Business | Education | Arts, Humanities and Others\n", "Alabama | Total | 25 and older | 885,357 | 263,555 | 98,445 | 210,147 | 141,071 | 172,139\n", "Alabama | Total | 25 to 39 | 268,924 | 90,736 | 32,378 | 58,515 | 29,342 | 57,953\n", "Alabama | Total | 40 to 64 | 418,480 | 115,762 | 46,724 | 112,271 | 63,875 | 79,848\n", "Alabama | Total | 65 and older | 197,953 | 57,057 | 19,343 | 39,361 | 47,854 | 34,338\n", "Alabama | Male | 25 and older | 405,618 | 159,366 | 26,004 | 113,909 | 29,490 | 76,849" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from datascience import *\n", "import numpy as np\n", "\n", "%matplotlib inline\n", "import matplotlib.pyplot as plots\n", "plots.style.use('fivethirtyeight')\n", "\n", "import warnings\n", "warnings.simplefilter('ignore'