{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Practicum 1 - September 22, 2025" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Due Date: Monday, September 22nd no later than 12:50 p.m.\n", "- Submission Instructions: Upload your solution, entitled **YourFirstName-YourLastName-Practicum1.ipynb** to the \n", "Canvas Practicum 1 Dropbox." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Starting Code" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Only use *datascience* and *numpy* libraries. Do not import anything else." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from datascience import *\n", "import numpy as np\n", "\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data File" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We are going to investigate where some of the Montana jobs were created in 2023.\n", "Download [jobs-2023.csv]\n", "(https://www.cs.montana.edu/paxton/classes/fall-2025/intro-ds/practicums/practicum1/jobs-2023.csv)\n", "and place it in the same directory as your Jupyter notebook. Each entry in the file contains\n", "the name of a company, a number of jobs created and the city where these jobs were created.\n", "Note: A company can create new jobs all through the year anywhere in the state!" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place the csv file in the same directory as this notebook\n", "jobs = Table().read_table(\"jobs-2023.csv\")\n", "jobs.show(5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 1 - 10 points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Part A. Display a table that shows each individual entry for the city \"Malta\"." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Part B. Display a second table that shows each individual entry for \"MALTA\"." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 2 - 20 points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Question 1 illustrates that some data cleaning is needed.\n", "Clean the **jobs** table by only using uppercase letters for city names (e.g. \"BOZEMAN\").\n", "Display the first five entries in the cleaned table.\n", "\n", "*Hint: Consider \"Bozeman\".upper()*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 3 - 20 points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using the cleaned table from Question 2, create a table called **jobs_by_city** \n", "that contains two columns: (1) **City** - the name of the city\n", "and (2) **Jobs** - the total number of jobs created in that city. Sort the table such that the city\n", "with the most jobs created is at the top. Display the first five entries of the table.\n", "\n", "*Hint: If done correctly, the third largest number of jobs created will be 1931.*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 4 - 20 points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To the **jobs_by_city** Table of Question 3, add a column named \"Percent\" that displays the percentage of jobs that were created in\n", "each city. Display the first five entries of the table. The \"%\" column should be formatted to display percentages, e.g. **12.34%**.\n", "\n", "*Hint: If done correctly, the third entry in the Percent column will be 14.18%.*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 5 - 15 Points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display a bar chart that shows the city on the y-axis and the number of jobs created on the\n", "x-axis. The bar chart should only display the 10 cities where the most jobs were created. The\n", "cities should be displayed in descending order by the number of jobs created." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 6 - 15 points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Give the city where the most jobs were created the number 1, the city where the second most\n", "number of jobs were created the number 2, etc. Then display a line graph where the x-axis\n", "is these numbers (e.g. 1, 2, 3, ...) and the y-axis is the number of jobs created in the\n", "corresponding city." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.7" } }, "nbformat": 4, "nbformat_minor": 4 }