{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "00b675f80cec0b02f01b07feeb88813b", "grade": false,...

1 answer below »
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
Answered 1 days AfterNov 02, 2021

Answer To: { "cells": [ { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false,...

Sathishkumar answered on Nov 03 2021
126 Votes
airline,avail_seat_km_per_week,incidents_85_99,fatal_accidents_85_99,fatalities_85_99,incidents_00_14,fatal_accidents_00_14,fatalities_00_14
Aer Lingus,320906734,2,0,0,0,0,0
Aeroflot*,1197672318,76,14,128,6,1,88
Aerolineas Argentinas,385803648,6,0,0,1,0,0
Aeromexico*,596871813,3,1,64,5,0,0
Air Canada,1865253802,2,0,0,2,0,0
Air France,3004002661,14,4,79,6,2,337
Air India*,869253552,2,1,329,4,1,158
Air New Zealand*,710174817,3,0,0,5,1,7
Alaska Airlines*,965346773,5,0,0,5,1,88
Alitalia,698012498,7,2,50,4,0,0
All Nippon Airways,1841234177,3,1,1,7,0,0
American*,5228357340,21,5,101,17,3,416
Austrian Airlines,358239823,1,0,0,1,0,0
Avianca,396922563,5,3,323,0,0,0
British...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here