{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Practice Problems\n", "### Lecture 8\n", "Answer each number in a separate cell\n", "\n", "Rename this notebook with your last name and the lecture \n", " \n", " ex. Cych_B_08\n", " \n", "Turn-in this notebook on Canvas. " ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "1. Adding notes in matplotlib.pyplot\n", " - Similar to the lecture:\n", " - Read the file 'Datasets/seismicRecord/earthquake.txt'into a pandas DataFrame\n", " - Change the units of the x-axis to time in minutes\n", " - Make a plot of velocity against time\n", " - Include a label for the x and y-axis. \n", " - Plot the line red\n", " - Use **help( )** to learn about the matplotlib function **title( )** then add this title: 'Earthquake observed at Pinyon Flat Observatory'\n", " - Add a note\n", " - Place the note at x = 4 and y = 170000 \n", " - Write the text 'P-S delay interval'\n", " - Color the text blue\n", " - rotate the text so that it is vertical (hint: use rotation = 90)\n", "2. Panda DataFrames\n", " - Import the file 'Datasets/TravelTimeDelta/DeltaTime.txt' into a panda DataFrame\n", " - Get acquainted with the DataFrame:\n", " - print out the name of the columns\n", " - print out the first few lines of the DataFrame\n", " - change the column headers \n", " - print out the new column headers\n", " - Convert the P wave arrival from minutes and seconds to decimal minutes. Add the P wave arrival, in decimal minutes, to the data frame\n", " - Calculate the S wave arrival by:\n", " 1. Converting S-P to decimal minutes\n", " 2. Adding P in decimal minutes to S-P in decimal minutes\n", " \n", "3. Additional matplotlib.pyplot practice\n", " - Plot Degrees against decimal minutes for both the Primary wave arrival and the Secondary wave arrival\n", " - Color the primary wave green and label it \"P wave\"\n", " - Color the shear wave blue and label it \"Shear wave\"\n", " - Add a legend in the lower right hand corner of your figure \n", " - Add a title to your figure \n", " - Add a label to the x and y axis \n", " - Save the figure\n", " - Remove the legend from your plot. Insert the text \"Primary wave\" and \"Shear wave\" above the appropriate line\n", " - Save the new figure" ] }, { "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 }