Please disregard Project 2 Proposal section
{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "00b675f80cec0b02f01b07feeb88813b", "grade": false, "grade_id": "cell-4cc0ffd6a5810c6d", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "## Unit 10 Assignment - W200 Introduction to Data Science Programming, UC Berkeley MIDS\n", "\n", "Write code in this Jupyter Notebook to solve the following problems. Please upload this **Notebook** with your solutions to your GitHub repository in your SUBMISSIONS/week_11 folder by 11:59PM PST the night before class. Do not push the data files to your repo." ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "a92fc4676cda916f921341132ae88dfb", "grade": false, "grade_id": "cell-1f3ffd327d56ecbc", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "This homework assignment is Week 11 which corresponds to the Unit #10 and a small part of Unit #11 async. " ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "9024dc80ab22e33198f91320d65a593a", "grade": false, "grade_id": "cell-c398835a920065f4", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "## Objectives\n", "- Demonstrate use of map and filter commands\n", "- Practice list comprehensions and lambda functions\n", "- Understand different ways to manipulate and perform calculations on Numpy arrays including:\n", "- Changing datatypes, getting the max values in each column and row, calculating the mean of a matrix\n", "- Matrix value comparisons and slicing of values\n", "- Load a file into a pandas dataframe and demonstrate some filtering" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "8567ea813027ec2494a660c445e4a9f9", "grade": false, "grade_id": "cell-bc58b3da65c5de3c", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "## General Guidelines:\n", "\n", "- All calculations need to be done in the functions (that includes any formatting of the output)\n", "- Name your functions exactly as written in the problem statement\n", "- Please have your functions return the answer rather than printing it inside the function\n", "- Do not make a separate input() statement. The functions will be passed the input as shown in the examples\n", "- The examples given are samples of how we will test/grade your code. Please ensure your functions output the same information\n", "- Answer format is graded - please match the examples\n", "- Docstrings and comments in your code are strongly suggested but won't be graded\n", "- This homework is mostly auto-graded. The blank code blocks are the auto-grading scripts - please do not delete these!\n", "- Your code needs to be written in the #Your Code Here blocks or it wont be graded correctly.\n" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "ad9412d3653684f40616663dbe2261a0", "grade": false, "grade_id": "cell-0719bd99a26f5a20", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "## Project 2 Proposal\n", "\n", "**Reminder!** Please complete your project 2 proposal, as discussed in class and outlined in the project_2 folder. As a group, submit your 1-2 page proposal as a PDF in your group project 2 repo. Please only submit one final version to be graded to your group repo!\n", "\n", "This is worth 10 points of your **project 2** grade (not the grade for this homework)." ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "97574d222090b936bfdf3ba78f538ae5", "grade": false, "grade_id": "cell-855c75985f9edefd", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "## 1. List, Mapping, Filtering, and Reducing Comprehensions (30 points)\n", "\n", "A. Write a function named `compute` below that: \n", "- Returns the square of any number for integer or floating type values\n", "- Returns the reverse of the content if it is a string\n", "- Or returns the **value None** (not the string 'None') if it is another kind of value." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "933d3d8fe603a01febac026c8a2c9852", "grade": false, "grade_id": "cell-dfddd13006f81c36", "locked": false, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "def compute(value):\n", " # YOUR CODE HERE\n", " raise NotImplementedError()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "5c1423b7df242ddf203f4ffa45d55ce7", "grade": true, "grade_id": "cell-88242cbaef2afe19", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "### Autograded cells. Do not remove." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "3d5d4e06f87cf4ecc78d1af83d7df3d2", "grade": true, "grade_id": "cell-a54757f9e0cf6953", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "### Autograded cells. Do not remove." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "605432815c3ba407a52d91dbcdc4da00", "grade": true, "grade_id": "cell-61c74abebff6dbc1", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "### Autograded cells. Do not remove." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "613249a69014af1411ef4ea121c07c7e", "grade": true, "grade_id": "cell-257a5430df922fd1", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "### Autograded