{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Homework 2 - Chapter 7" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Due Date: Monday, September 8th no later than 11:59 p.m.\n", "- Partner Information: Complete this assignment individually.\n", "- Submission Instructions: Upload your solution, entitled **YourFirstName-YourLastName-Homework2.ipynb** to the \n", "BrightSpace Homework 2 Dropbox.\n", "- Deadline Reminder: Once the submission deadline passes, BrightSpace will no longer accept your submission and you will no longer be able to earn credit. Thus, if you are not able to fully complete the assignment, submit whatever you have before the deadline so that partial credit can be earned." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Starting Code" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from datascience import *\n", "%matplotlib inline\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data File" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fall is a wonderful time of the year for fly-fishing in Montana. There are other\n", "parts of the world that also offer good fishing. For this assignment, you will investigate\n", "salmon fishing in Scotland.\n", "Download [scotland-salmon.csv](https://www.cs.montana.edu/paxton/classes/fall-2025/intro-ds/homeworks/hw2/scotland-salmon.csv)\n", "and place it in the same directory as your Jupyter notebook." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place the csv file in the same directory as this notebook\n", "fishing = Table().read_table(\"scotland-salmon.csv\")\n", "fishing.show(5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 1a - 2 Points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display a scatter plot with year on the x-axis and the average weight of all of the salmon caught in that year on the y-axis. Hint: If average weight is calculated correctly, the average weight for the earliest year, 1952, will be between 5.00 and 5.25." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 1b - 1 point" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Is the average weight of a salmon being caught each year generally increasing, staying the same or declining? \n", "Provide a reasonable explanation of the trend you observe." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Answer** -" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 2a - 1 point" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display a line graph with year on the x-axis and the total weight of all of the salmon caught in that year on the y-axis." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 2b - 1 point" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Are the number of salmon being caught each year generally increasing, staying the same or declining? \n", "Provide a reasonable explanation of the trend observed." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Answer** - " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 3a - 2 Points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display a bar chart with month on the y-axis and the total number of all of the salmon caught in that month\n", "over the years on the x-axis. The bar chart should be sorted in descending order so that the month with the\n", "most salmon caught appears at the top." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place answer here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 3b - 1 Point" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* What is the best month to go salmon fishing in Scotland? \n", "* What are the months when salmon fishing season appears to be closed?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Answer** - " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 4 - 2 points" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display a histogram of the average weight of salmon caught in each of the 19,900 months that\n", "appear in the data file. The histogram should bin the data in 22 intervals of 0.5 (kg) with the\n", "first interval starting at 0." ] }, { "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 }