{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Practice Problems\n", "### Lecture 26\n", "Answer each number in a separate cell\n", "\n", "Rename the notebook with your lastName, first initial and the lecture \n", " \n", " ex. Cych_B_26\n", " \n", "Turn this notebook into Canvas." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Mplot3d\n", "- Import **random** from numpy and use it to generate 3 arrays- each with 10 random values. \n", "- Plot the points using the **Axes3D** **.add_subplot** to make a 3D figure object. Then use the method **ax.scatter( )** to plot the data as blue dots. \n", "- Label your axes. \n", "\n", "## 2. Mplot3d and subduction zones\n", "- Modify the 3D figure of the earthquakes around the Marianas Trench.\n", " - Read in the data in Datasets/EarthquakeLocations/last5Years.csv as a DataFrame and filter with the box as in the lecture. \n", " - Look at the columns in the filtered DataFrame **box**\n", " - What is the magnitude of the largest earthquake? the smallest earthquake?\n", " - Change the color to blue and set the opacity using the **alpha** keyword.\n", " - Make an array of sizes from the 'mag' column and raise 32 to the magnetudes (to be proportional to the energy released. \n", " - Normalize the array by the mean value, then multiply by 10.\n", " - Set the symbol size in the 3D figure, to be proportional to your sizes array. \n", " - **Hint:** use the keyword argument **s** to set the markersize" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }