{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd \n", "import numpy as np \n", "import matplotlib.pyplot as plt " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Solution to Exercises" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Great Migration\n", "\n", "DATASETS: migration.xlsx; uscities.xlsx " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "2) We'll use pandas to import the datafile migration.xlsx into a dataframe called migration." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | \n", " | lat | \n", "lon | \n", "Mig2 | \n", "Mig1 | \n", "
---|---|---|---|---|---|
city | \n", "state | \n", "\n", " | \n", " | \n", " | \n", " |
Seattle | \n", "WA | \n", "47.6211 | \n", "-122.3244 | \n", "0.1 | \n", "6.1 | \n", "
Spokane | \n", "WA | \n", "47.6671 | \n", "-117.4330 | \n", "-0.2 | \n", "0.7 | \n", "