{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "64d0f59c-8588-4f78-8bd5-078627729d92",
   "metadata": {},
   "source": [
    "## Introduction to Data Science\n",
    "\n",
    "#### University of Redlands - DATA 101\n",
    "#### Prof: Joanna Bieri [joanna_bieri@redlands.edu](mailto:joanna_bieri@redlands.edu)\n",
    "#### [Class Website: data101.joannabieri.com](https://data101.joannabieri.com)\n",
    "\n",
    "---------------------------------------\n",
    "# Homework Day 3\n",
    "---------------------------------------\n",
    "\n",
    "GOALS:\n",
    "\n",
    "1. Answer all the questions from the lecture.\n",
    "2. Practice making graphs with data.\n",
    "\n",
    "**IMPORTANT NOTE: For most people doing the HW problems while watching the lecture is really helpful. You can watch the section of the lecture, pause it, and then work on the problems.**\n",
    "\n",
    "----------------------------------------------------------\n",
    "\n",
    "For this homework you will load the Star Wars data and practice making different kinds of plots!\n",
    "\n",
    "This homework has **8 questions** from the lecture and **2 Problems**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "85d851b3-4123-484c-a51a-561490abcc68",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:24.139822Z",
     "iopub.status.busy": "2026-09-02T20:59:24.139189Z",
     "iopub.status.idle": "2026-09-02T20:59:25.793536Z",
     "shell.execute_reply": "2026-09-02T20:59:25.793020Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "import plotly.express as px\n",
    "from plotly.subplots import make_subplots\n",
    "import plotly.io as pio\n",
    "pio.renderers.default = 'notebook_connected'\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0d9997ae-4d12-48cc-8229-9ec76d59e9a5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:25.795171Z",
     "iopub.status.busy": "2026-09-02T20:59:25.794998Z",
     "iopub.status.idle": "2026-09-02T20:59:26.034963Z",
     "shell.execute_reply": "2026-09-02T20:59:26.033515Z"
    }
   },
   "outputs": [],
   "source": [
    "file_location = 'https://joannabieri.com/introdatascience/data/starwars.csv'\n",
    "DF = pd.read_csv(file_location)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5bd623a5-72ac-4f8b-96e3-1518e1e1f46c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.039327Z",
     "iopub.status.busy": "2026-09-02T20:59:26.038840Z",
     "iopub.status.idle": "2026-09-02T20:59:26.070379Z",
     "shell.execute_reply": "2026-09-02T20:59:26.069862Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>height</th>\n",
       "      <th>mass</th>\n",
       "      <th>hair_color</th>\n",
       "      <th>skin_color</th>\n",
       "      <th>eye_color</th>\n",
       "      <th>birth_year</th>\n",
       "      <th>sex</th>\n",
       "      <th>gender</th>\n",
       "      <th>homeworld</th>\n",
       "      <th>species</th>\n",
       "      <th>films</th>\n",
       "      <th>vehicles</th>\n",
       "      <th>starships</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Luke Skywalker</td>\n",
       "      <td>172.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>blond</td>\n",
       "      <td>fair</td>\n",
       "      <td>blue</td>\n",
       "      <td>19.0</td>\n",
       "      <td>male</td>\n",
       "      <td>masculine</td>\n",
       "      <td>Tatooine</td>\n",
       "      <td>Human</td>\n",
       "      <td>A New Hope, The Empire Strikes Back, Return of...</td>\n",
       "      <td>Snowspeeder, Imperial Speeder Bike</td>\n",
       "      <td>X-wing, Imperial shuttle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>C-3PO</td>\n",
       "      <td>167.0</td>\n",
       "      <td>75.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>gold</td>\n",
       "      <td>yellow</td>\n",
       "      <td>112.0</td>\n",
       "      <td>none</td>\n",
       "      <td>masculine</td>\n",
       "      <td>Tatooine</td>\n",
       "      <td>Droid</td>\n",
       "      <td>A New Hope, The Empire Strikes Back, Return of...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>R2-D2</td>\n",
       "      <td>96.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>white, blue</td>\n",
       "      <td>red</td>\n",
       "      <td>33.0</td>\n",
       "      <td>none</td>\n",
       "      <td>masculine</td>\n",
       "      <td>Naboo</td>\n",
       "      <td>Droid</td>\n",
       "      <td>A New Hope, The Empire Strikes Back, Return of...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Darth Vader</td>\n",
       "      <td>202.0</td>\n",
       "      <td>136.0</td>\n",
       "      <td>none</td>\n",
       "      <td>white</td>\n",
       "      <td>yellow</td>\n",
       "      <td>41.9</td>\n",
       "      <td>male</td>\n",
       "      <td>masculine</td>\n",
       "      <td>Tatooine</td>\n",
       "      <td>Human</td>\n",
       "      <td>A New Hope, The Empire Strikes Back, Return of...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TIE Advanced x1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Leia Organa</td>\n",
       "      <td>150.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>brown</td>\n",
       "      <td>light</td>\n",
       "      <td>brown</td>\n",
       "      <td>19.0</td>\n",
       "      <td>female</td>\n",
       "      <td>feminine</td>\n",
       "      <td>Alderaan</td>\n",
       "      <td>Human</td>\n",
       "      <td>A New Hope, The Empire Strikes Back, Return of...</td>\n",
       "      <td>Imperial Speeder Bike</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>Finn</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>black</td>\n",
       "      <td>dark</td>\n",
       "      <td>dark</td>\n",
       "      <td>NaN</td>\n",
       "      <td>male</td>\n",
       "      <td>masculine</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Human</td>\n",
       "      <td>The Force Awakens</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>Rey</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>brown</td>\n",
       "      <td>light</td>\n",
       "      <td>hazel</td>\n",
       "      <td>NaN</td>\n",
       "      <td>female</td>\n",
       "      <td>feminine</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Human</td>\n",
       "      <td>The Force Awakens</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>Poe Dameron</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>brown</td>\n",
       "      <td>light</td>\n",
       "      <td>brown</td>\n",
       "      <td>NaN</td>\n",
       "      <td>male</td>\n",
       "      <td>masculine</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Human</td>\n",
       "      <td>The Force Awakens</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X-wing</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>BB8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>none</td>\n",
       "      <td>none</td>\n",
       "      <td>black</td>\n",
       "      <td>NaN</td>\n",
       "      <td>none</td>\n",
       "      <td>masculine</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Droid</td>\n",
       "      <td>The Force Awakens</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>Captain Phasma</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>none</td>\n",
       "      <td>none</td>\n",
       "      <td>unknown</td>\n",
       "      <td>NaN</td>\n",
       "      <td>female</td>\n",
       "      <td>feminine</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Human</td>\n",
       "      <td>The Force Awakens</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>87 rows \u00d7 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              name  height   mass hair_color   skin_color eye_color  \\\n",
       "0   Luke Skywalker   172.0   77.0      blond         fair      blue   \n",
       "1            C-3PO   167.0   75.0        NaN         gold    yellow   \n",
       "2            R2-D2    96.0   32.0        NaN  white, blue       red   \n",
       "3      Darth Vader   202.0  136.0       none        white    yellow   \n",
       "4      Leia Organa   150.0   49.0      brown        light     brown   \n",
       "..             ...     ...    ...        ...          ...       ...   \n",
       "82            Finn     NaN    NaN      black         dark      dark   \n",
       "83             Rey     NaN    NaN      brown        light     hazel   \n",
       "84     Poe Dameron     NaN    NaN      brown        light     brown   \n",
       "85             BB8     NaN    NaN       none         none     black   \n",
       "86  Captain Phasma     NaN    NaN       none         none   unknown   \n",
       "\n",
       "    birth_year     sex     gender homeworld species  \\\n",
       "0         19.0    male  masculine  Tatooine   Human   \n",
       "1        112.0    none  masculine  Tatooine   Droid   \n",
       "2         33.0    none  masculine     Naboo   Droid   \n",
       "3         41.9    male  masculine  Tatooine   Human   \n",
       "4         19.0  female   feminine  Alderaan   Human   \n",
       "..         ...     ...        ...       ...     ...   \n",
       "82         NaN    male  masculine       NaN   Human   \n",
       "83         NaN  female   feminine       NaN   Human   \n",
       "84         NaN    male  masculine       NaN   Human   \n",
       "85         NaN    none  masculine       NaN   Droid   \n",
       "86         NaN  female   feminine       NaN   Human   \n",
       "\n",
       "                                                films  \\\n",
       "0   A New Hope, The Empire Strikes Back, Return of...   \n",
       "1   A New Hope, The Empire Strikes Back, Return of...   \n",
       "2   A New Hope, The Empire Strikes Back, Return of...   \n",
       "3   A New Hope, The Empire Strikes Back, Return of...   \n",
       "4   A New Hope, The Empire Strikes Back, Return of...   \n",
       "..                                                ...   \n",
       "82                                  The Force Awakens   \n",
       "83                                  The Force Awakens   \n",
       "84                                  The Force Awakens   \n",
       "85                                  The Force Awakens   \n",
       "86                                  The Force Awakens   \n",
       "\n",
       "                              vehicles                 starships  \n",
       "0   Snowspeeder, Imperial Speeder Bike  X-wing, Imperial shuttle  \n",
       "1                                  NaN                       NaN  \n",
       "2                                  NaN                       NaN  \n",
       "3                                  NaN           TIE Advanced x1  \n",
       "4                Imperial Speeder Bike                       NaN  \n",
       "..                                 ...                       ...  \n",
       "82                                 NaN                       NaN  \n",
       "83                                 NaN                       NaN  \n",
       "84                                 NaN                    X-wing  \n",
       "85                                 NaN                       NaN  \n",
       "86                                 NaN                       NaN  \n",
       "\n",
       "[87 rows x 14 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(DF)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b8ce2965-1253-4593-85c5-eb187fd2d028",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.072219Z",
     "iopub.status.busy": "2026-09-02T20:59:26.072045Z",
     "iopub.status.idle": "2026-09-02T20:59:26.080905Z",
     "shell.execute_reply": "2026-09-02T20:59:26.080534Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>height</th>\n",
       "      <th>mass</th>\n",
       "      <th>hair_color</th>\n",
       "      <th>skin_color</th>\n",
       "      <th>eye_color</th>\n",
       "      <th>birth_year</th>\n",
       "      <th>sex</th>\n",
       "      <th>gender</th>\n",
       "      <th>homeworld</th>\n",
       "      <th>species</th>\n",
       "      <th>films</th>\n",
       "      <th>vehicles</th>\n",
       "      <th>starships</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Luke Skywalker</td>\n",
       "      <td>172.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>blond</td>\n",
       "      <td>fair</td>\n",
       "      <td>blue</td>\n",
       "      <td>19.0</td>\n",
       "      <td>male</td>\n",
       "      <td>masculine</td>\n",
       "      <td>Tatooine</td>\n",
       "      <td>Human</td>\n",
       "      <td>A New Hope, The Empire Strikes Back, Return of...</td>\n",
       "      <td>Snowspeeder, Imperial Speeder Bike</td>\n",
       "      <td>X-wing, Imperial shuttle</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             name  height  mass hair_color skin_color eye_color  birth_year  \\\n",
       "0  Luke Skywalker   172.0  77.0      blond       fair      blue        19.0   \n",
       "\n",
       "    sex     gender homeworld species  \\\n",
       "0  male  masculine  Tatooine   Human   \n",
       "\n",
       "                                               films  \\\n",
       "0  A New Hope, The Empire Strikes Back, Return of...   \n",
       "\n",
       "                             vehicles                 starships  \n",
       "0  Snowspeeder, Imperial Speeder Bike  X-wing, Imperial shuttle  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "observation_name = 'Luke Skywalker'\n",
    "# Select just the row where the name equals Luke Skywalker\n",
    "DF[DF['name']==observation_name]\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c048f99a-1aa0-4746-a163-9ce27a746a55",
   "metadata": {},
   "source": [
    "**Q1** How would you update the cell above to search for a different character? Make a change to the code above to find information about C-3PO."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "26747497-aee3-4c19-bd39-fbcadae31504",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.082361Z",
     "iopub.status.busy": "2026-09-02T20:59:26.082199Z",
     "iopub.status.idle": "2026-09-02T20:59:26.087922Z",
     "shell.execute_reply": "2026-09-02T20:59:26.087549Z"
    }
   },
   "outputs": [],
   "source": [
    "# Your code here:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dc718850-25a9-45eb-8c24-a993782747fb",
   "metadata": {},
   "source": [
    "**Q2** In the data for C-3PO one of the entries says NaN. What does this mean?\n",
    "\n",
    "[Who is C-3PO?](https://www.starwars.com/databank/c-3po)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "00567e47",
   "metadata": {},
   "source": [
    "**(Double Click Here)** to answer the question."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8ec6d294-4f57-408f-bcd2-273d252ee757",
   "metadata": {},
   "source": [
    "**Q3** Look at some observations for other characters. Just choose a few different names and see what their data says."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "75b788ec-3580-45ac-a08b-05e0fb1dc678",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.089472Z",
     "iopub.status.busy": "2026-09-02T20:59:26.089311Z",
     "iopub.status.idle": "2026-09-02T20:59:26.096096Z",
     "shell.execute_reply": "2026-09-02T20:59:26.095758Z"
    }
   },
   "outputs": [],
   "source": [
    "# Your code here - or you can just rerun the code cell above.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1cc4bd94-18db-4006-8e15-75cb1caf711e",
   "metadata": {},
   "source": [
    "**Q4** What happens if you spell a name wrong or forget to capitalize?"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f448205-202b-4131-98cb-de6c37100667",
   "metadata": {},
   "source": [
    "**(Double Click Here)**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bd8255c0-9d90-402e-9017-64a382e2b5be",
   "metadata": {},
   "source": [
    "**Q5** Check out each of the variables (columns):\n",
    "\n",
    "1. What does each column tell you?\n",
    "2. Is the data a word or a number or something else?\n",
    "3. If the data is a number, what are the units?\n",
    "\n",
    "-----------------------------------------"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "88a25285-8c62-48c4-8ef4-3031b97c93a9",
   "metadata": {},
   "source": [
    "**(Double Click Here)**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "08f9ffc9-e880-448b-bc5f-30d7c7f973d0",
   "metadata": {},
   "source": [
    "### Exploratory Data Analysis (EDA)\n",
    "\n",
    "1. Summary Statistics\n",
    "2. Visualization (Today's Class)\n",
    "3. Data Wrangling (Future Class)\n",
    "\n",
    "#### Graph Mass vs. Height\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "6a2d9c12-6ba9-4c3a-bc6a-1971c01c263b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.097563Z",
     "iopub.status.busy": "2026-09-02T20:59:26.097410Z",
     "iopub.status.idle": "2026-09-02T20:59:26.258977Z",
     "shell.execute_reply": "2026-09-02T20:59:26.258527Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "        <script type=\"text/javascript\">\n",
       "        window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
       "        if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
       "        </script>\n",
       "        <script type=\"module\">import \"https://cdn.plot.ly/plotly-3.1.0.min\"</script>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
       "        <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-3.1.0.min.js\" integrity=\"sha256-Ei4740bWZhaUTQuD6q9yQlgVCMPBz6CZWhevDYPv93A=\" crossorigin=\"anonymous\"></script>                <div id=\"341a8d0b-80fd-44f7-9d5f-644b49528d4f\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>            <script type=\"text/javascript\">                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById(\"341a8d0b-80fd-44f7-9d5f-644b49528d4f\")) {                    Plotly.newPlot(                        \"341a8d0b-80fd-44f7-9d5f-644b49528d4f\",                        [{\"hovertemplate\":\"height=%{x}\\u003cbr\\u003emass=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"\",\"marker\":{\"color\":\"#636efa\",\"symbol\":\"circle\"},\"mode\":\"markers\",\"name\":\"\",\"orientation\":\"v\",\"showlegend\":false,\"x\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAACAZUAAAAAAAOBkQAAAAAAAAFhAAAAAAABAaUAAAAAAAMBiQAAAAAAAQGZAAAAAAACgZEAAAAAAAEBYQAAAAAAA4GZAAAAAAADAZkAAAAAAAIBnQAAAAAAAgGZAAAAAAACAbEAAAAAAAIBmQAAAAAAAoGVAAAAAAADgZUAAAAAAAEBlQAAAAAAAgGZAAAAAAACAUEAAAAAAAEBlQAAAAAAA4GZAAAAAAAAAaUAAAAAAAMBnQAAAAAAAIGZAAAAAAADgZUAAAAAAAIBmQAAAAAAAwGJAAAAAAAAA+H8AAAAAAABWQAAAAAAAAGRAAAAAAAAgaEAAAAAAAOBnQAAAAAAAQGVAAAAAAAAgZ0AAAAAAAIBoQAAAAAAAAGxAAAAAAADAaUAAAAAAAOBmQAAAAAAAIGFAAAAAAAAAXEAAAAAAAOBmQAAAAAAAYGRAAAAAAADgZUAAAAAAAIBmQAAAAAAAQGZAAAAAAADAU0AAAAAAAIBXQAAAAAAAgF5AAAAAAABgZEAAAAAAAIBnQAAAAAAAwGhAAAAAAACAaEAAAAAAAGBlQAAAAAAAAGdAAAAAAACAZ0AAAAAAAIBwQAAAAAAAgGdAAAAAAACAaEAAAAAAACBnQAAAAAAAoGNAAAAAAADgZkAAAAAAAOBmQAAAAAAAQGVAAAAAAADAZEAAAAAAAKBkQAAAAAAAIGhAAAAAAADgZ0AAAAAAAOBmQAAAAAAAAGVAAAAAAADAaEAAAAAAAKBsQAAAAAAAoGpAAAAAAADgZEAAAAAAAABYQAAAAAAAIGhAAAAAAADgZ0AAAAAAAEBmQAAAAAAAAGtAAAAAAABAbUAAAAAAAIBnQAAAAAAAQGZAAAAAAADAaUAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002f\"},\"xaxis\":\"x\",\"y\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAABAU0AAAAAAAMBSQAAAAAAAAEBAAAAAAAAAYUAAAAAAAIBIQAAAAAAAAF5AAAAAAADAUkAAAAAAAABAQAAAAAAAAFVAAAAAAABAU0AAAAAAAABVQAAAAAAAAPh\\u002fAAAAAAAAXEAAAAAAAABUQAAAAAAAgFJAAAAAAAA4lUAAAAAAAEBTQAAAAAAAgFtAAAAAAAAAMUAAAAAAAMBSQM3MzMzMjFNAAAAAAACAYUAAAAAAAEBcQAAAAAAAwFNAAAAAAADAU0AAAAAAAMBUQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAA0QAAAAAAAAFFAAAAAAABAVkAAAAAAAIBWQAAAAAAAAPh\\u002fAAAAAACARkAAAAAAAIBQQAAAAAAAgFRAAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAAREAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAAVEAAAAAAAAD4fwAAAAAAgEtAAAAAAAAALkAAAAAAAIBGQAAAAAAAAPh\\u002fAAAAAABAUEAAAAAAAABVQAAAAAAAgFRAAAAAAADAVUAAAAAAAAD4fwAAAAAAAElAAAAAAAAA+H8AAAAAAAD4fwAAAAAAAFRAAAAAAAAA+H8AAAAAAEBVQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAABUQJqZmZmZGUxAAAAAAAAASUAAAAAAAAD4fwAAAAAAAFRAAAAAAAAA+H8AAAAAAMBTQAAAAAAAgEtAAAAAAACAWUAAAAAAAABWQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAEhAAAAAAAAA+H8AAAAAAIBMQAAAAAAA4GNAAAAAAAAAYUAAAAAAAMBTQAAAAAAAAEhAAAAAAAAAVEAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002f\"},\"yaxis\":\"y\",\"type\":\"scatter\"}],                        {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermap\":[{\"type\":\"scattermap\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"height\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"mass\"}},\"legend\":{\"tracegroupgap\":0},\"title\":{\"text\":\"Mass vs. Height of Starwars Characters\"}},                        {\"responsive\": true}                    ).then(function(){\n",
       "                            \n",
       "var gd = document.getElementById('341a8d0b-80fd-44f7-9d5f-644b49528d4f');\n",
       "var x = new MutationObserver(function (mutations, observer) {{\n",
       "        var display = window.getComputedStyle(gd).display;\n",
       "        if (!display || display === 'none') {{\n",
       "            console.log([gd, 'removed!']);\n",
       "            Plotly.purge(gd);\n",
       "            observer.disconnect();\n",
       "        }}\n",
       "}});\n",
       "\n",
       "// Listen for the removal of the full notebook cells\n",
       "var notebookContainer = gd.closest('#notebook-container');\n",
       "if (notebookContainer) {{\n",
       "    x.observe(notebookContainer, {childList: true});\n",
       "}}\n",
       "\n",
       "// Listen for the clearing of the current output cell\n",
       "var outputEl = gd.closest('.output');\n",
       "if (outputEl) {{\n",
       "    x.observe(outputEl, {childList: true});\n",
       "}}\n",
       "\n",
       "                        })                };            </script>        </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = px.scatter(DF,\n",
    "                 x='height',\n",
    "                 y='mass',\n",
    "                 title='Mass vs. Height of Starwars Characters')\n",
    "fig.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "69e2e95d-f2b6-478a-8abf-199182396a99",
   "metadata": {},
   "source": [
    "**Q6** What do you notice about this graph? Are there any strange data points?"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eaa97e0d-0691-40f3-9cde-d1acd4536efa",
   "metadata": {},
   "source": [
    "**(Double Click Here)**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "40945f6e-1a32-4c95-9a56-686a09db83f2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.260463Z",
     "iopub.status.busy": "2026-09-02T20:59:26.260297Z",
     "iopub.status.idle": "2026-09-02T20:59:26.313506Z",
     "shell.execute_reply": "2026-09-02T20:59:26.313068Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
       "        <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-3.1.0.min.js\" integrity=\"sha256-Ei4740bWZhaUTQuD6q9yQlgVCMPBz6CZWhevDYPv93A=\" crossorigin=\"anonymous\"></script>                <div id=\"71f1653f-7208-4eb7-af58-45015b5ef679\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>            <script type=\"text/javascript\">                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById(\"71f1653f-7208-4eb7-af58-45015b5ef679\")) {                    Plotly.newPlot(                        \"71f1653f-7208-4eb7-af58-45015b5ef679\",                        [{\"customdata\":[[\"Luke Skywalker\"],[\"C-3PO\"],[\"R2-D2\"],[\"Darth Vader\"],[\"Leia Organa\"],[\"Owen Lars\"],[\"Beru Whitesun Lars\"],[\"R5-D4\"],[\"Biggs Darklighter\"],[\"Obi-Wan Kenobi\"],[\"Anakin Skywalker\"],[\"Wilhuff Tarkin\"],[\"Chewbacca\"],[\"Han Solo\"],[\"Greedo\"],[\"Jabba Desilijic Tiure\"],[\"Wedge Antilles\"],[\"Jek Tono Porkins\"],[\"Yoda\"],[\"Palpatine\"],[\"Boba Fett\"],[\"IG-88\"],[\"Bossk\"],[\"Lando Calrissian\"],[\"Lobot\"],[\"Ackbar\"],[\"Mon Mothma\"],[\"Arvel Crynyd\"],[\"Wicket Systri Warrick\"],[\"Nien Nunb\"],[\"Qui-Gon Jinn\"],[\"Nute Gunray\"],[\"Finis Valorum\"],[\"Padm\u00e9 Amidala\"],[\"Jar Jar Binks\"],[\"Roos Tarpals\"],[\"Rugor Nass\"],[\"Ric Oli\u00e9\"],[\"Watto\"],[\"Sebulba\"],[\"Quarsh Panaka\"],[\"Shmi Skywalker\"],[\"Darth Maul\"],[\"Bib Fortuna\"],[\"Ayla Secura\"],[\"Ratts Tyerel\"],[\"Dud Bolt\"],[\"Gasgano\"],[\"Ben Quadinaros\"],[\"Mace Windu\"],[\"Ki-Adi-Mundi\"],[\"Kit Fisto\"],[\"Eeth Koth\"],[\"Adi Gallia\"],[\"Saesee Tiin\"],[\"Yarael Poof\"],[\"Plo Koon\"],[\"Mas Amedda\"],[\"Gregar Typho\"],[\"Cord\u00e9\"],[\"Cliegg Lars\"],[\"Poggle the Lesser\"],[\"Luminara Unduli\"],[\"Barriss Offee\"],[\"Dorm\u00e9\"],[\"Dooku\"],[\"Bail Prestor Organa\"],[\"Jango Fett\"],[\"Zam Wesell\"],[\"Dexter Jettster\"],[\"Lama Su\"],[\"Taun We\"],[\"Jocasta Nu\"],[\"R4-P17\"],[\"Wat Tambor\"],[\"San Hill\"],[\"Shaak Ti\"],[\"Grievous\"],[\"Tarfful\"],[\"Raymus Antilles\"],[\"Sly Moore\"],[\"Tion Medon\"],[\"Finn\"],[\"Rey\"],[\"Poe Dameron\"],[\"BB8\"],[\"Captain Phasma\"]],\"hovertemplate\":\"height=%{x}\\u003cbr\\u003emass=%{y}\\u003cbr\\u003ename=%{customdata[0]}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"\",\"marker\":{\"color\":\"#636efa\",\"symbol\":\"circle\"},\"mode\":\"markers\",\"name\":\"\",\"orientation\":\"v\",\"showlegend\":false,\"x\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAACAZUAAAAAAAOBkQAAAAAAAAFhAAAAAAABAaUAAAAAAAMBiQAAAAAAAQGZAAAAAAACgZEAAAAAAAEBYQAAAAAAA4GZAAAAAAADAZkAAAAAAAIBnQAAAAAAAgGZAAAAAAACAbEAAAAAAAIBmQAAAAAAAoGVAAAAAAADgZUAAAAAAAEBlQAAAAAAAgGZAAAAAAACAUEAAAAAAAEBlQAAAAAAA4GZAAAAAAAAAaUAAAAAAAMBnQAAAAAAAIGZAAAAAAADgZUAAAAAAAIBmQAAAAAAAwGJAAAAAAAAA+H8AAAAAAABWQAAAAAAAAGRAAAAAAAAgaEAAAAAAAOBnQAAAAAAAQGVAAAAAAAAgZ0AAAAAAAIBoQAAAAAAAAGxAAAAAAADAaUAAAAAAAOBmQAAAAAAAIGFAAAAAAAAAXEAAAAAAAOBmQAAAAAAAYGRAAAAAAADgZUAAAAAAAIBmQAAAAAAAQGZAAAAAAADAU0AAAAAAAIBXQAAAAAAAgF5AAAAAAABgZEAAAAAAAIBnQAAAAAAAwGhAAAAAAACAaEAAAAAAAGBlQAAAAAAAAGdAAAAAAACAZ0AAAAAAAIBwQAAAAAAAgGdAAAAAAACAaEAAAAAAACBnQAAAAAAAoGNAAAAAAADgZkAAAAAAAOBmQAAAAAAAQGVAAAAAAADAZEAAAAAAAKBkQAAAAAAAIGhAAAAAAADgZ0AAAAAAAOBmQAAAAAAAAGVAAAAAAADAaEAAAAAAAKBsQAAAAAAAoGpAAAAAAADgZEAAAAAAAABYQAAAAAAAIGhAAAAAAADgZ0AAAAAAAEBmQAAAAAAAAGtAAAAAAABAbUAAAAAAAIBnQAAAAAAAQGZAAAAAAADAaUAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002f\"},\"xaxis\":\"x\",\"y\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAABAU0AAAAAAAMBSQAAAAAAAAEBAAAAAAAAAYUAAAAAAAIBIQAAAAAAAAF5AAAAAAADAUkAAAAAAAABAQAAAAAAAAFVAAAAAAABAU0AAAAAAAABVQAAAAAAAAPh\\u002fAAAAAAAAXEAAAAAAAABUQAAAAAAAgFJAAAAAAAA4lUAAAAAAAEBTQAAAAAAAgFtAAAAAAAAAMUAAAAAAAMBSQM3MzMzMjFNAAAAAAACAYUAAAAAAAEBcQAAAAAAAwFNAAAAAAADAU0AAAAAAAMBUQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAA0QAAAAAAAAFFAAAAAAABAVkAAAAAAAIBWQAAAAAAAAPh\\u002fAAAAAACARkAAAAAAAIBQQAAAAAAAgFRAAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAAREAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAAVEAAAAAAAAD4fwAAAAAAgEtAAAAAAAAALkAAAAAAAIBGQAAAAAAAAPh\\u002fAAAAAABAUEAAAAAAAABVQAAAAAAAgFRAAAAAAADAVUAAAAAAAAD4fwAAAAAAAElAAAAAAAAA+H8AAAAAAAD4fwAAAAAAAFRAAAAAAAAA+H8AAAAAAEBVQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAABUQJqZmZmZGUxAAAAAAAAASUAAAAAAAAD4fwAAAAAAAFRAAAAAAAAA+H8AAAAAAMBTQAAAAAAAgEtAAAAAAACAWUAAAAAAAABWQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAEhAAAAAAAAA+H8AAAAAAIBMQAAAAAAA4GNAAAAAAAAAYUAAAAAAAMBTQAAAAAAAAEhAAAAAAAAAVEAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002f\"},\"yaxis\":\"y\",\"type\":\"scatter\"}],                        {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermap\":[{\"type\":\"scattermap\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"height\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"mass\"}},\"legend\":{\"tracegroupgap\":0},\"title\":{\"text\":\"Mass vs. Height of Starwars Characters.\"}},                        {\"responsive\": true}                    ).then(function(){\n",
       "                            \n",
       "var gd = document.getElementById('71f1653f-7208-4eb7-af58-45015b5ef679');\n",
       "var x = new MutationObserver(function (mutations, observer) {{\n",
       "        var display = window.getComputedStyle(gd).display;\n",
       "        if (!display || display === 'none') {{\n",
       "            console.log([gd, 'removed!']);\n",
       "            Plotly.purge(gd);\n",
       "            observer.disconnect();\n",
       "        }}\n",
       "}});\n",
       "\n",
       "// Listen for the removal of the full notebook cells\n",
       "var notebookContainer = gd.closest('#notebook-container');\n",
       "if (notebookContainer) {{\n",
       "    x.observe(notebookContainer, {childList: true});\n",
       "}}\n",
       "\n",
       "// Listen for the clearing of the current output cell\n",
       "var outputEl = gd.closest('.output');\n",
       "if (outputEl) {{\n",
       "    x.observe(outputEl, {childList: true});\n",
       "}}\n",
       "\n",
       "                        })                };            </script>        </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Let's add some data so when we hover over the point we can see the characters name:\n",
    "fig = px.scatter(DF,\n",
    "                 x='height',\n",
    "                 y='mass',\n",
    "                 title='Mass vs. Height of Starwars Characters.',\n",
    "                 hover_data='name')\n",
    "fig.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4e1fc345-9c53-4fd9-8c85-20aacb27eb28",
   "metadata": {},
   "source": [
    "#### You try birth_year vs mass\n",
    "\n",
    "**Q7** See if you can figure out how to make a plot of the birth_year vs mass with the hover data being the name?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "8c796598-5da7-454b-b1c8-f0d7342aae70",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.314966Z",
     "iopub.status.busy": "2026-09-02T20:59:26.314805Z",
     "iopub.status.idle": "2026-09-02T20:59:26.316961Z",
     "shell.execute_reply": "2026-09-02T20:59:26.316546Z"
    }
   },
   "outputs": [],
   "source": [
    "# Your code here:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0548a2d8-0708-4b97-8150-f3be3f1f0f6d",
   "metadata": {},
   "source": [
    "---------------------------\n",
    "--------------------------\n",
    "\n",
    "## Why Visualize?!?!\n",
    "\n",
    "Load the data for Anscombe's Quartet"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "b9bc6271-6f86-4a1c-8e72-447da749a226",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.318326Z",
     "iopub.status.busy": "2026-09-02T20:59:26.318175Z",
     "iopub.status.idle": "2026-09-02T20:59:26.520008Z",
     "shell.execute_reply": "2026-09-02T20:59:26.518117Z"
    }
   },
   "outputs": [],
   "source": [
    "# Load the data\n",
    "#| label: Download data\n",
    "#| warning: false\n",
    "\n",
    "file_location = 'https://joannabieri.com/introdatascience/data/Anscombe_quartet_data.csv'\n",
    "DF_new = pd.read_csv(file_location)\n",
    "\n",
    "# Some code to make the data frame look nicer\n",
    "DF_new = DF_new.drop(['x4'], axis=1)\n",
    "DF_new.rename(columns={'x123':'x'}, inplace=True)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ba7e5222-17ca-4963-8d9a-13c65afdacef",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.525748Z",
     "iopub.status.busy": "2026-09-02T20:59:26.525053Z",
     "iopub.status.idle": "2026-09-02T20:59:26.549395Z",
     "shell.execute_reply": "2026-09-02T20:59:26.548547Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y1</th>\n",
       "      <th>y2</th>\n",
       "      <th>y3</th>\n",
       "      <th>y4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10.0</td>\n",
       "      <td>8.04</td>\n",
       "      <td>9.14</td>\n",
       "      <td>7.46</td>\n",
       "      <td>6.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>8.0</td>\n",
       "      <td>6.95</td>\n",
       "      <td>8.14</td>\n",
       "      <td>6.77</td>\n",
       "      <td>5.76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13.0</td>\n",
       "      <td>7.58</td>\n",
       "      <td>8.74</td>\n",
       "      <td>12.74</td>\n",
       "      <td>7.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>9.0</td>\n",
       "      <td>8.81</td>\n",
       "      <td>8.77</td>\n",
       "      <td>7.11</td>\n",
       "      <td>8.84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>11.0</td>\n",
       "      <td>8.33</td>\n",
       "      <td>9.26</td>\n",
       "      <td>7.81</td>\n",
       "      <td>8.47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>14.0</td>\n",
       "      <td>9.96</td>\n",
       "      <td>8.10</td>\n",
       "      <td>8.84</td>\n",
       "      <td>7.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6.0</td>\n",
       "      <td>7.24</td>\n",
       "      <td>6.13</td>\n",
       "      <td>6.08</td>\n",
       "      <td>5.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4.0</td>\n",
       "      <td>4.26</td>\n",
       "      <td>3.10</td>\n",
       "      <td>5.39</td>\n",
       "      <td>12.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>12.0</td>\n",
       "      <td>10.84</td>\n",
       "      <td>9.13</td>\n",
       "      <td>8.15</td>\n",
       "      <td>5.56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>7.0</td>\n",
       "      <td>4.82</td>\n",
       "      <td>7.26</td>\n",
       "      <td>6.42</td>\n",
       "      <td>7.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>5.0</td>\n",
       "      <td>5.68</td>\n",
       "      <td>4.74</td>\n",
       "      <td>5.73</td>\n",
       "      <td>6.89</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       x     y1    y2     y3     y4\n",
       "0   10.0   8.04  9.14   7.46   6.58\n",
       "1    8.0   6.95  8.14   6.77   5.76\n",
       "2   13.0   7.58  8.74  12.74   7.71\n",
       "3    9.0   8.81  8.77   7.11   8.84\n",
       "4   11.0   8.33  9.26   7.81   8.47\n",
       "5   14.0   9.96  8.10   8.84   7.04\n",
       "6    6.0   7.24  6.13   6.08   5.25\n",
       "7    4.0   4.26  3.10   5.39  12.50\n",
       "8   12.0  10.84  9.13   8.15   5.56\n",
       "9    7.0   4.82  7.26   6.42   7.91\n",
       "10   5.0   5.68  4.74   5.73   6.89"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(DF_new)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "23bdb68f-b1f3-4a37-8ac9-7c04bfeaddf1",
   "metadata": {},
   "source": [
    "#### Summary Statistics\n",
    "\n",
    "Pandas can do all sorts of statistics for us really quickly using the .describe() function!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "fb0a1b3b-7b5f-4dc4-82d5-8d747ff5fbff",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.551935Z",
     "iopub.status.busy": "2026-09-02T20:59:26.551666Z",
     "iopub.status.idle": "2026-09-02T20:59:26.578775Z",
     "shell.execute_reply": "2026-09-02T20:59:26.578249Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y1</th>\n",
       "      <th>y2</th>\n",
       "      <th>y3</th>\n",
       "      <th>y4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>11.000000</td>\n",
       "      <td>11.000000</td>\n",
       "      <td>11.000000</td>\n",
       "      <td>11.000000</td>\n",
       "      <td>11.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>9.000000</td>\n",
       "      <td>7.500909</td>\n",
       "      <td>7.500909</td>\n",
       "      <td>7.500000</td>\n",
       "      <td>7.500909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.316625</td>\n",
       "      <td>2.031568</td>\n",
       "      <td>2.031657</td>\n",
       "      <td>2.030424</td>\n",
       "      <td>2.030579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.260000</td>\n",
       "      <td>3.100000</td>\n",
       "      <td>5.390000</td>\n",
       "      <td>5.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>6.500000</td>\n",
       "      <td>6.315000</td>\n",
       "      <td>6.695000</td>\n",
       "      <td>6.250000</td>\n",
       "      <td>6.170000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>9.000000</td>\n",
       "      <td>7.580000</td>\n",
       "      <td>8.140000</td>\n",
       "      <td>7.110000</td>\n",
       "      <td>7.040000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>11.500000</td>\n",
       "      <td>8.570000</td>\n",
       "      <td>8.950000</td>\n",
       "      <td>7.980000</td>\n",
       "      <td>8.190000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>14.000000</td>\n",
       "      <td>10.840000</td>\n",
       "      <td>9.260000</td>\n",
       "      <td>12.740000</td>\n",
       "      <td>12.500000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               x         y1         y2         y3         y4\n",
       "count  11.000000  11.000000  11.000000  11.000000  11.000000\n",
       "mean    9.000000   7.500909   7.500909   7.500000   7.500909\n",
       "std     3.316625   2.031568   2.031657   2.030424   2.030579\n",
       "min     4.000000   4.260000   3.100000   5.390000   5.250000\n",
       "25%     6.500000   6.315000   6.695000   6.250000   6.170000\n",
       "50%     9.000000   7.580000   8.140000   7.110000   7.040000\n",
       "75%    11.500000   8.570000   8.950000   7.980000   8.190000\n",
       "max    14.000000  10.840000   9.260000  12.740000  12.500000"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DF_new.describe()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "76a59090-a87f-4684-a2f3-020712926be9",
   "metadata": {},
   "source": [
    "#### Visualization\n",
    "\n",
    "Make a scatter plot for each of the y-values. Here is the first one:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "45f2d0eb-2144-41d9-81b9-2f21c2b8f66e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.580519Z",
     "iopub.status.busy": "2026-09-02T20:59:26.580303Z",
     "iopub.status.idle": "2026-09-02T20:59:26.629948Z",
     "shell.execute_reply": "2026-09-02T20:59:26.629504Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
       "        <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-3.1.0.min.js\" integrity=\"sha256-Ei4740bWZhaUTQuD6q9yQlgVCMPBz6CZWhevDYPv93A=\" crossorigin=\"anonymous\"></script>                <div id=\"9648942e-0877-4ced-9b19-8a105f502e90\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>            <script type=\"text/javascript\">                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById(\"9648942e-0877-4ced-9b19-8a105f502e90\")) {                    Plotly.newPlot(                        \"9648942e-0877-4ced-9b19-8a105f502e90\",                        [{\"hovertemplate\":\"x=%{x}\\u003cbr\\u003ey1=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"\",\"marker\":{\"color\":\"#636efa\",\"symbol\":\"circle\"},\"mode\":\"markers\",\"name\":\"\",\"orientation\":\"v\",\"showlegend\":false,\"x\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAAAAJEAAAAAAAAAgQAAAAAAAACpAAAAAAAAAIkAAAAAAAAAmQAAAAAAAACxAAAAAAAAAGEAAAAAAAAAQQAAAAAAAAChAAAAAAAAAHEAAAAAAAAAUQA==\"},\"xaxis\":\"x\",\"y\":{\"dtype\":\"f8\",\"bdata\":\"FK5H4XoUIEDNzMzMzMwbQFK4HoXrUR5AH4XrUbieIUApXI\\u002fC9aggQOxRuB6F6yNA9ihcj8L1HEAK16NwPQoRQK5H4XoUriVASOF6FK5HE0C4HoXrUbgWQA==\"},\"yaxis\":\"y\",\"type\":\"scatter\"}],                        {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermap\":[{\"type\":\"scattermap\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"x\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"y1\"}},\"legend\":{\"tracegroupgap\":0},\"title\":{\"text\":\"x vs y1\"}},                        {\"responsive\": true}                    ).then(function(){\n",
       "                            \n",
       "var gd = document.getElementById('9648942e-0877-4ced-9b19-8a105f502e90');\n",
       "var x = new MutationObserver(function (mutations, observer) {{\n",
       "        var display = window.getComputedStyle(gd).display;\n",
       "        if (!display || display === 'none') {{\n",
       "            console.log([gd, 'removed!']);\n",
       "            Plotly.purge(gd);\n",
       "            observer.disconnect();\n",
       "        }}\n",
       "}});\n",
       "\n",
       "// Listen for the removal of the full notebook cells\n",
       "var notebookContainer = gd.closest('#notebook-container');\n",
       "if (notebookContainer) {{\n",
       "    x.observe(notebookContainer, {childList: true});\n",
       "}}\n",
       "\n",
       "// Listen for the clearing of the current output cell\n",
       "var outputEl = gd.closest('.output');\n",
       "if (outputEl) {{\n",
       "    x.observe(outputEl, {childList: true});\n",
       "}}\n",
       "\n",
       "                        })                };            </script>        </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = px.scatter(DF_new,x='x',y='y1',title='x vs y1')\n",
    "fig.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "31da2430-beba-43f4-8443-336201ed777b",
   "metadata": {},
   "source": [
    "**Q8** Now you make the other three plots! What do you notice? Are they all the same?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "06399ea8-da0c-47ce-a945-6b5448c66933",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.631399Z",
     "iopub.status.busy": "2026-09-02T20:59:26.631239Z",
     "iopub.status.idle": "2026-09-02T20:59:26.633691Z",
     "shell.execute_reply": "2026-09-02T20:59:26.633216Z"
    }
   },
   "outputs": [],
   "source": [
    "# Your code here:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "97f1144f-71a4-470d-8baa-6eec5531088c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.635007Z",
     "iopub.status.busy": "2026-09-02T20:59:26.634858Z",
     "iopub.status.idle": "2026-09-02T20:59:26.642629Z",
     "shell.execute_reply": "2026-09-02T20:59:26.642226Z"
    }
   },
   "outputs": [],
   "source": [
    "# Your code here:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "5246cc9e-a2e2-4b08-bcb5-8606a55de6cc",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.643924Z",
     "iopub.status.busy": "2026-09-02T20:59:26.643777Z",
     "iopub.status.idle": "2026-09-02T20:59:26.651716Z",
     "shell.execute_reply": "2026-09-02T20:59:26.651309Z"
    }
   },
   "outputs": [],
   "source": [
    "# Your code here:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e7d3cdce-d876-43ea-ba33-8c58479a4623",
   "metadata": {},
   "source": [
    "**(Double Click Here)** to answer the questions about the graphs"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "95998a5e-8f7b-442c-bfe4-9281e4b01fe3",
   "metadata": {},
   "source": [
    "### Problem 1\n",
    "\n",
    "Let's try to make an even fancier graph of the Star Wars height vs mass data. \n",
    "\n",
    "Below you will find code that changes our Star Wars graph in the following ways:\n",
    "\n",
    "1. It changes the marker size to 15\n",
    "2. It changes the marker color to red\n",
    "3. It changes the marker symbol to be a star\n",
    "4. It makes the markers see through (opacity)\n",
    "5. It puts a line around the marker with a width and color given.\n",
    "\n",
    "Now your job is to make this plot your own. Change the colors, markers, etc.\n",
    "\n",
    "Below you will see a list of all possible colors and markers that are automatically part of plotly."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "079045c1-84fe-4412-b273-db55e441790f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.653125Z",
     "iopub.status.busy": "2026-09-02T20:59:26.652977Z",
     "iopub.status.idle": "2026-09-02T20:59:26.711775Z",
     "shell.execute_reply": "2026-09-02T20:59:26.711337Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
       "        <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-3.1.0.min.js\" integrity=\"sha256-Ei4740bWZhaUTQuD6q9yQlgVCMPBz6CZWhevDYPv93A=\" crossorigin=\"anonymous\"></script>                <div id=\"536467be-2c45-436d-918d-f0ce58261de2\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>            <script type=\"text/javascript\">                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById(\"536467be-2c45-436d-918d-f0ce58261de2\")) {                    Plotly.newPlot(                        \"536467be-2c45-436d-918d-f0ce58261de2\",                        [{\"customdata\":[[\"Luke Skywalker\"],[\"C-3PO\"],[\"R2-D2\"],[\"Darth Vader\"],[\"Leia Organa\"],[\"Owen Lars\"],[\"Beru Whitesun Lars\"],[\"R5-D4\"],[\"Biggs Darklighter\"],[\"Obi-Wan Kenobi\"],[\"Anakin Skywalker\"],[\"Wilhuff Tarkin\"],[\"Chewbacca\"],[\"Han Solo\"],[\"Greedo\"],[\"Jabba Desilijic Tiure\"],[\"Wedge Antilles\"],[\"Jek Tono Porkins\"],[\"Yoda\"],[\"Palpatine\"],[\"Boba Fett\"],[\"IG-88\"],[\"Bossk\"],[\"Lando Calrissian\"],[\"Lobot\"],[\"Ackbar\"],[\"Mon Mothma\"],[\"Arvel Crynyd\"],[\"Wicket Systri Warrick\"],[\"Nien Nunb\"],[\"Qui-Gon Jinn\"],[\"Nute Gunray\"],[\"Finis Valorum\"],[\"Padm\u00e9 Amidala\"],[\"Jar Jar Binks\"],[\"Roos Tarpals\"],[\"Rugor Nass\"],[\"Ric Oli\u00e9\"],[\"Watto\"],[\"Sebulba\"],[\"Quarsh Panaka\"],[\"Shmi Skywalker\"],[\"Darth Maul\"],[\"Bib Fortuna\"],[\"Ayla Secura\"],[\"Ratts Tyerel\"],[\"Dud Bolt\"],[\"Gasgano\"],[\"Ben Quadinaros\"],[\"Mace Windu\"],[\"Ki-Adi-Mundi\"],[\"Kit Fisto\"],[\"Eeth Koth\"],[\"Adi Gallia\"],[\"Saesee Tiin\"],[\"Yarael Poof\"],[\"Plo Koon\"],[\"Mas Amedda\"],[\"Gregar Typho\"],[\"Cord\u00e9\"],[\"Cliegg Lars\"],[\"Poggle the Lesser\"],[\"Luminara Unduli\"],[\"Barriss Offee\"],[\"Dorm\u00e9\"],[\"Dooku\"],[\"Bail Prestor Organa\"],[\"Jango Fett\"],[\"Zam Wesell\"],[\"Dexter Jettster\"],[\"Lama Su\"],[\"Taun We\"],[\"Jocasta Nu\"],[\"R4-P17\"],[\"Wat Tambor\"],[\"San Hill\"],[\"Shaak Ti\"],[\"Grievous\"],[\"Tarfful\"],[\"Raymus Antilles\"],[\"Sly Moore\"],[\"Tion Medon\"],[\"Finn\"],[\"Rey\"],[\"Poe Dameron\"],[\"BB8\"],[\"Captain Phasma\"]],\"hovertemplate\":\"height=%{x}\\u003cbr\\u003emass=%{y}\\u003cbr\\u003ename=%{customdata[0]}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"\",\"marker\":{\"color\":\"red\",\"symbol\":\"star\",\"line\":{\"color\":\"DarkSlateGrey\",\"width\":2},\"opacity\":0.5,\"size\":15},\"mode\":\"markers\",\"name\":\"\",\"orientation\":\"v\",\"showlegend\":false,\"x\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAACAZUAAAAAAAOBkQAAAAAAAAFhAAAAAAABAaUAAAAAAAMBiQAAAAAAAQGZAAAAAAACgZEAAAAAAAEBYQAAAAAAA4GZAAAAAAADAZkAAAAAAAIBnQAAAAAAAgGZAAAAAAACAbEAAAAAAAIBmQAAAAAAAoGVAAAAAAADgZUAAAAAAAEBlQAAAAAAAgGZAAAAAAACAUEAAAAAAAEBlQAAAAAAA4GZAAAAAAAAAaUAAAAAAAMBnQAAAAAAAIGZAAAAAAADgZUAAAAAAAIBmQAAAAAAAwGJAAAAAAAAA+H8AAAAAAABWQAAAAAAAAGRAAAAAAAAgaEAAAAAAAOBnQAAAAAAAQGVAAAAAAAAgZ0AAAAAAAIBoQAAAAAAAAGxAAAAAAADAaUAAAAAAAOBmQAAAAAAAIGFAAAAAAAAAXEAAAAAAAOBmQAAAAAAAYGRAAAAAAADgZUAAAAAAAIBmQAAAAAAAQGZAAAAAAADAU0AAAAAAAIBXQAAAAAAAgF5AAAAAAABgZEAAAAAAAIBnQAAAAAAAwGhAAAAAAACAaEAAAAAAAGBlQAAAAAAAAGdAAAAAAACAZ0AAAAAAAIBwQAAAAAAAgGdAAAAAAACAaEAAAAAAACBnQAAAAAAAoGNAAAAAAADgZkAAAAAAAOBmQAAAAAAAQGVAAAAAAADAZEAAAAAAAKBkQAAAAAAAIGhAAAAAAADgZ0AAAAAAAOBmQAAAAAAAAGVAAAAAAADAaEAAAAAAAKBsQAAAAAAAoGpAAAAAAADgZEAAAAAAAABYQAAAAAAAIGhAAAAAAADgZ0AAAAAAAEBmQAAAAAAAAGtAAAAAAABAbUAAAAAAAIBnQAAAAAAAQGZAAAAAAADAaUAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002f\"},\"xaxis\":\"x\",\"y\":{\"dtype\":\"f8\",\"bdata\":\"AAAAAABAU0AAAAAAAMBSQAAAAAAAAEBAAAAAAAAAYUAAAAAAAIBIQAAAAAAAAF5AAAAAAADAUkAAAAAAAABAQAAAAAAAAFVAAAAAAABAU0AAAAAAAABVQAAAAAAAAPh\\u002fAAAAAAAAXEAAAAAAAABUQAAAAAAAgFJAAAAAAAA4lUAAAAAAAEBTQAAAAAAAgFtAAAAAAAAAMUAAAAAAAMBSQM3MzMzMjFNAAAAAAACAYUAAAAAAAEBcQAAAAAAAwFNAAAAAAADAU0AAAAAAAMBUQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAA0QAAAAAAAAFFAAAAAAABAVkAAAAAAAIBWQAAAAAAAAPh\\u002fAAAAAACARkAAAAAAAIBQQAAAAAAAgFRAAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAAREAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAAVEAAAAAAAAD4fwAAAAAAgEtAAAAAAAAALkAAAAAAAIBGQAAAAAAAAPh\\u002fAAAAAABAUEAAAAAAAABVQAAAAAAAgFRAAAAAAADAVUAAAAAAAAD4fwAAAAAAAElAAAAAAAAA+H8AAAAAAAD4fwAAAAAAAFRAAAAAAAAA+H8AAAAAAEBVQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAABUQJqZmZmZGUxAAAAAAAAASUAAAAAAAAD4fwAAAAAAAFRAAAAAAAAA+H8AAAAAAMBTQAAAAAAAgEtAAAAAAACAWUAAAAAAAABWQAAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAEhAAAAAAAAA+H8AAAAAAIBMQAAAAAAA4GNAAAAAAAAAYUAAAAAAAMBTQAAAAAAAAEhAAAAAAAAAVEAAAAAAAAD4fwAAAAAAAPh\\u002fAAAAAAAA+H8AAAAAAAD4fwAAAAAAAPh\\u002f\"},\"yaxis\":\"y\",\"type\":\"scatter\"}],                        {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermap\":[{\"type\":\"scattermap\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"height\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"mass\"}},\"legend\":{\"tracegroupgap\":0},\"title\":{\"text\":\"Mass vs. Height of Starwars Characters.\"}},                        {\"responsive\": true}                    ).then(function(){\n",
       "                            \n",
       "var gd = document.getElementById('536467be-2c45-436d-918d-f0ce58261de2');\n",
       "var x = new MutationObserver(function (mutations, observer) {{\n",
       "        var display = window.getComputedStyle(gd).display;\n",
       "        if (!display || display === 'none') {{\n",
       "            console.log([gd, 'removed!']);\n",
       "            Plotly.purge(gd);\n",
       "            observer.disconnect();\n",
       "        }}\n",
       "}});\n",
       "\n",
       "// Listen for the removal of the full notebook cells\n",
       "var notebookContainer = gd.closest('#notebook-container');\n",
       "if (notebookContainer) {{\n",
       "    x.observe(notebookContainer, {childList: true});\n",
       "}}\n",
       "\n",
       "// Listen for the clearing of the current output cell\n",
       "var outputEl = gd.closest('.output');\n",
       "if (outputEl) {{\n",
       "    x.observe(outputEl, {childList: true});\n",
       "}}\n",
       "\n",
       "                        })                };            </script>        </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = px.scatter(DF,\n",
    "                 x='height',\n",
    "                 y='mass',\n",
    "                 title='Mass vs. Height of Starwars Characters.',\n",
    "                 hover_data='name')\n",
    "fig.update_traces(marker={'size': 15,\n",
    "                          'color' : 'red', \n",
    "                          'symbol' : 'star',\n",
    "                          'opacity' : 0.5,\n",
    "                          'line':{'width':2,'color':'DarkSlateGrey'}})\n",
    "fig.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b9fea077-a50f-4ef0-b61f-7a7443e719b6",
   "metadata": {},
   "source": [
    "![Plotly Available Colors](images/colors.png)\n",
    "\n",
    "![Plotly Available Symbols](images/symbols.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "85734f55-c856-41bc-8279-fdf7057df538",
   "metadata": {},
   "source": [
    "### Problem 2\n",
    "\n",
    "Interacting with new types of plots! Over the course of the semester we will learn how to make all sorts of fancy plots. Below is code that makes a histogram of the different hair colors for the Star Wars characters. \n",
    "\n",
    "A. Figure out what the code does.\n",
    "\n",
    "B. Change the code:\n",
    "* New variable (x)\n",
    "* New color\n",
    "* New Title"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "f7377484-3bce-4632-86cd-a48692a37684",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-09-02T20:59:26.713318Z",
     "iopub.status.busy": "2026-09-02T20:59:26.713148Z",
     "iopub.status.idle": "2026-09-02T20:59:26.758817Z",
     "shell.execute_reply": "2026-09-02T20:59:26.758390Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
       "        <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-3.1.0.min.js\" integrity=\"sha256-Ei4740bWZhaUTQuD6q9yQlgVCMPBz6CZWhevDYPv93A=\" crossorigin=\"anonymous\"></script>                <div id=\"9547db52-2841-4e7f-b6ef-e29d3dcc5438\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>            <script type=\"text/javascript\">                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById(\"9547db52-2841-4e7f-b6ef-e29d3dcc5438\")) {                    Plotly.newPlot(                        \"9547db52-2841-4e7f-b6ef-e29d3dcc5438\",                        [{\"bingroup\":\"x\",\"hovertemplate\":\"Hair Color=%{x}\\u003cbr\\u003ecount=%{y}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"legendgroup\":\"\",\"marker\":{\"color\":\"lightseagreen\",\"opacity\":0.8,\"pattern\":{\"shape\":\"\"}},\"name\":\"\",\"orientation\":\"v\",\"showlegend\":false,\"x\":[\"blond\",null,null,\"none\",\"brown\",\"brown, grey\",\"brown\",null,\"black\",\"auburn, white\",\"blond\",\"auburn, grey\",\"brown\",\"brown\",null,null,\"brown\",\"brown\",\"white\",\"grey\",\"black\",\"none\",\"none\",\"black\",\"none\",\"none\",\"auburn\",\"brown\",\"brown\",\"none\",\"brown\",\"none\",\"blond\",\"brown\",\"none\",\"none\",\"none\",\"brown\",\"black\",\"none\",\"black\",\"black\",\"none\",\"none\",\"none\",\"none\",\"none\",\"none\",\"none\",\"none\",\"white\",\"none\",\"black\",\"none\",\"none\",\"none\",\"none\",\"none\",\"black\",\"brown\",\"brown\",\"none\",\"black\",\"black\",\"brown\",\"white\",\"black\",\"black\",\"blonde\",\"none\",\"none\",\"none\",\"white\",\"none\",\"none\",\"none\",\"none\",\"none\",\"brown\",\"brown\",\"none\",\"none\",\"black\",\"brown\",\"brown\",\"none\",\"none\"],\"xaxis\":\"x\",\"yaxis\":\"y\",\"type\":\"histogram\"}],                        {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermap\":[{\"type\":\"scattermap\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"Hair Color\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"count\"}},\"legend\":{\"tracegroupgap\":0},\"margin\":{\"t\":60},\"barmode\":\"relative\",\"title\":{\"text\":\"Histogram Hair Color in the Star Wars Universe\",\"x\":0.5},\"bargap\":0.1},                        {\"responsive\": true}                    ).then(function(){\n",
       "                            \n",
       "var gd = document.getElementById('9547db52-2841-4e7f-b6ef-e29d3dcc5438');\n",
       "var x = new MutationObserver(function (mutations, observer) {{\n",
       "        var display = window.getComputedStyle(gd).display;\n",
       "        if (!display || display === 'none') {{\n",
       "            console.log([gd, 'removed!']);\n",
       "            Plotly.purge(gd);\n",
       "            observer.disconnect();\n",
       "        }}\n",
       "}});\n",
       "\n",
       "// Listen for the removal of the full notebook cells\n",
       "var notebookContainer = gd.closest('#notebook-container');\n",
       "if (notebookContainer) {{\n",
       "    x.observe(notebookContainer, {childList: true});\n",
       "}}\n",
       "\n",
       "// Listen for the clearing of the current output cell\n",
       "var outputEl = gd.closest('.output');\n",
       "if (outputEl) {{\n",
       "    x.observe(outputEl, {childList: true});\n",
       "}}\n",
       "\n",
       "                        })                };            </script>        </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = px.histogram(DF,\n",
    "                   x='hair_color',\n",
    "                   labels={'hair_color':'Hair Color'},\n",
    "                   opacity=0.8,\n",
    "                   color_discrete_sequence=['lightseagreen'])\n",
    "fig.update_layout(bargap=0.1, title=\n",
    "            'Histogram Hair Color in the Star Wars Universe',\n",
    "            title_x=0.5)\n",
    "fig.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7ca844d4-d44b-4052-9da6-4250ebd46bdc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "83faf564-3892-46f3-a7a4-8009e1c78a78",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
