Created
September 25, 2024 00:00
-
-
Save isaaccorley/dbcc2741cd37f99d1f6d5207f6e1bf33 to your computer and use it in GitHub Desktop.
cs210_week2.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "nbformat": 4, | |
| "nbformat_minor": 0, | |
| "metadata": { | |
| "colab": { | |
| "provenance": [], | |
| "gpuType": "T4", | |
| "authorship_tag": "ABX9TyMn1+PgqFwJWl7GjIV40M5a", | |
| "include_colab_link": true | |
| }, | |
| "kernelspec": { | |
| "name": "python3", | |
| "display_name": "Python 3" | |
| }, | |
| "language_info": { | |
| "name": "python" | |
| }, | |
| "accelerator": "GPU" | |
| }, | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "view-in-github", | |
| "colab_type": "text" | |
| }, | |
| "source": [ | |
| "<a href=\"https://colab.research.google.com/gist/isaaccorley/dbcc2741cd37f99d1f6d5207f6e1bf33/cs210_week2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "Reading Excel/CSV files and Pandas" | |
| ], | |
| "metadata": { | |
| "id": "RAyAg595OW4b" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "import pandas\n", | |
| "import seaborn as sns\n", | |
| "import matplotlib.pyplot as plt\n", | |
| "sns.set_theme()\n", | |
| "sns.set_style()\n", | |
| "\n", | |
| "path = \"sample_data/california_housing_train.csv\"\n", | |
| "data = pandas.read_csv(path)\n", | |
| "data.head()" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 226 | |
| }, | |
| "id": "an5_IhupOWqg", | |
| "outputId": "1aaba8d2-6f76-4bd6-a10d-02da37ab461a" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " longitude latitude housing_median_age total_rooms total_bedrooms \\\n", | |
| "0 -114.31 34.19 15.0 5612.0 1283.0 \n", | |
| "1 -114.47 34.40 19.0 7650.0 1901.0 \n", | |
| "2 -114.56 33.69 17.0 720.0 174.0 \n", | |
| "3 -114.57 33.64 14.0 1501.0 337.0 \n", | |
| "4 -114.57 33.57 20.0 1454.0 326.0 \n", | |
| "\n", | |
| " population households median_income median_house_value \n", | |
| "0 1015.0 472.0 1.4936 66900.0 \n", | |
| "1 1129.0 463.0 1.8200 80100.0 \n", | |
| "2 333.0 117.0 1.6509 85700.0 \n", | |
| "3 515.0 226.0 3.1917 73400.0 \n", | |
| "4 624.0 262.0 1.9250 65500.0 " | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-ecac0e5c-bc35-4f90-9f5e-a6fa4e44ddd9\" class=\"colab-df-container\">\n", | |
| " <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>longitude</th>\n", | |
| " <th>latitude</th>\n", | |
| " <th>housing_median_age</th>\n", | |
| " <th>total_rooms</th>\n", | |
| " <th>total_bedrooms</th>\n", | |
| " <th>population</th>\n", | |
| " <th>households</th>\n", | |
| " <th>median_income</th>\n", | |
| " <th>median_house_value</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>-114.31</td>\n", | |
| " <td>34.19</td>\n", | |
| " <td>15.0</td>\n", | |
| " <td>5612.0</td>\n", | |
| " <td>1283.0</td>\n", | |
| " <td>1015.0</td>\n", | |
| " <td>472.0</td>\n", | |
| " <td>1.4936</td>\n", | |
| " <td>66900.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>-114.47</td>\n", | |
| " <td>34.40</td>\n", | |
| " <td>19.0</td>\n", | |
| " <td>7650.0</td>\n", | |
| " <td>1901.0</td>\n", | |
| " <td>1129.0</td>\n", | |
| " <td>463.0</td>\n", | |
| " <td>1.8200</td>\n", | |
| " <td>80100.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>-114.56</td>\n", | |
| " <td>33.69</td>\n", | |
| " <td>17.0</td>\n", | |
| " <td>720.0</td>\n", | |
| " <td>174.0</td>\n", | |
| " <td>333.0</td>\n", | |
| " <td>117.0</td>\n", | |
| " <td>1.6509</td>\n", | |
| " <td>85700.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>-114.57</td>\n", | |
| " <td>33.64</td>\n", | |
| " <td>14.0</td>\n", | |
| " <td>1501.0</td>\n", | |
| " <td>337.0</td>\n", | |
| " <td>515.0</td>\n", | |
| " <td>226.0</td>\n", | |
| " <td>3.1917</td>\n", | |
| " <td>73400.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>-114.57</td>\n", | |
| " <td>33.57</td>\n", | |
| " <td>20.0</td>\n", | |
| " <td>1454.0</td>\n", | |
| " <td>326.0</td>\n", | |
| " <td>624.0</td>\n", | |
| " <td>262.0</td>\n", | |
| " <td>1.9250</td>\n", | |
| " <td>65500.0</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-ecac0e5c-bc35-4f90-9f5e-a6fa4e44ddd9')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-ecac0e5c-bc35-4f90-9f5e-a6fa4e44ddd9 button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-ecac0e5c-bc35-4f90-9f5e-a6fa4e44ddd9');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-57992c59-2f19-42b0-9076-482fcc3b0d1b\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-57992c59-2f19-42b0-9076-482fcc3b0d1b')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-57992c59-2f19-42b0-9076-482fcc3b0d1b button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 17000,\n \"fields\": [\n {\n \"column\": \"longitude\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2.0051664084261778,\n \"min\": -124.35,\n \"max\": -114.31,\n \"num_unique_values\": 827,\n \"samples\": [\n -117.56,\n -123.32,\n -118.26\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"latitude\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2.1373397946570836,\n \"min\": 32.54,\n \"max\": 41.95,\n \"num_unique_values\": 840,\n \"samples\": [\n 38.44,\n 40.79,\n 32.69\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"housing_median_age\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 12.586936981660399,\n \"min\": 1.0,\n \"max\": 52.0,\n \"num_unique_values\": 52,\n \"samples\": [\n 23.0,\n 52.0,\n 47.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"total_rooms\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2179.947071452767,\n \"min\": 2.0,\n \"max\": 37937.0,\n \"num_unique_values\": 5533,\n \"samples\": [\n 3564.0,\n 6955.0,\n 5451.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"total_bedrooms\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 421.4994515798646,\n \"min\": 1.0,\n \"max\": 6445.0,\n \"num_unique_values\": 1848,\n \"samples\": [\n 729.0,\n 719.0,\n 2075.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"population\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1147.8529591595266,\n \"min\": 3.0,\n \"max\": 35682.0,\n \"num_unique_values\": 3683,\n \"samples\": [\n 249.0,\n 1735.0,\n 235.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"households\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 384.5208408559009,\n \"min\": 1.0,\n \"max\": 6082.0,\n \"num_unique_values\": 1740,\n \"samples\": [\n 390.0,\n 1089.0,\n 1351.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"median_income\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.9081565183791036,\n \"min\": 0.4999,\n \"max\": 15.0001,\n \"num_unique_values\": 11175,\n \"samples\": [\n 7.2655,\n 5.6293,\n 4.2262\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"median_house_value\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 115983.76438720885,\n \"min\": 14999.0,\n \"max\": 500001.0,\n \"num_unique_values\": 3694,\n \"samples\": [\n 162300.0,\n 346800.0,\n 116700.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 64 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Display one column\n", | |
| "data[\"population\"]" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 458 | |
| }, | |
| "id": "xLXsYSraOWpE", | |
| "outputId": "2e734b52-82e7-4c02-fff8-f4296c59bbfd" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "0 1015.0\n", | |
| "1 1129.0\n", | |
| "2 333.0\n", | |
| "3 515.0\n", | |
| "4 624.0\n", | |
| " ... \n", | |
| "16995 907.0\n", | |
| "16996 1194.0\n", | |
| "16997 1244.0\n", | |
| "16998 1298.0\n", | |
| "16999 806.0\n", | |
| "Name: population, Length: 17000, dtype: float64" | |
| ], | |
| "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>population</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>1015.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>1129.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>333.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>515.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>624.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>...</th>\n", | |
| " <td>...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16995</th>\n", | |
| " <td>907.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16996</th>\n", | |
| " <td>1194.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16997</th>\n", | |
| " <td>1244.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16998</th>\n", | |
| " <td>1298.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16999</th>\n", | |
| " <td>806.0</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>17000 rows × 1 columns</p>\n", | |
| "</div><br><label><b>dtype:</b> float64</label>" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "execution_count": 55 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Filtering data by a column condition\n", | |
| "condition = data[\"median_house_value\"] < 500000\n", | |
| "data[condition]" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 444 | |
| }, | |
| "id": "bcOm55WVOWnI", | |
| "outputId": "892cee61-bc7d-4035-c3de-e371d1105106" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " longitude latitude housing_median_age total_rooms total_bedrooms \\\n", | |
| "0 -114.31 34.19 15.0 5612.0 1283.0 \n", | |
| "1 -114.47 34.40 19.0 7650.0 1901.0 \n", | |
| "2 -114.56 33.69 17.0 720.0 174.0 \n", | |
| "3 -114.57 33.64 14.0 1501.0 337.0 \n", | |
| "4 -114.57 33.57 20.0 1454.0 326.0 \n", | |
| "... ... ... ... ... ... \n", | |
| "16995 -124.26 40.58 52.0 2217.0 394.0 \n", | |
| "16996 -124.27 40.69 36.0 2349.0 528.0 \n", | |
| "16997 -124.30 41.84 17.0 2677.0 531.0 \n", | |
| "16998 -124.30 41.80 19.0 2672.0 552.0 \n", | |
| "16999 -124.35 40.54 52.0 1820.0 300.0 \n", | |
| "\n", | |
| " population households median_income median_house_value \n", | |
| "0 1015.0 472.0 1.4936 66900.0 \n", | |
| "1 1129.0 463.0 1.8200 80100.0 \n", | |
| "2 333.0 117.0 1.6509 85700.0 \n", | |
| "3 515.0 226.0 3.1917 73400.0 \n", | |
| "4 624.0 262.0 1.9250 65500.0 \n", | |
| "... ... ... ... ... \n", | |
| "16995 907.0 369.0 2.3571 111400.0 \n", | |
| "16996 1194.0 465.0 2.5179 79000.0 \n", | |
| "16997 1244.0 456.0 3.0313 103600.0 \n", | |
| "16998 1298.0 478.0 1.9797 85800.0 \n", | |
| "16999 806.0 270.0 3.0147 94600.0 \n", | |
| "\n", | |
| "[16164 rows x 9 columns]" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-64f4f0b4-8ec5-4331-81f4-621a8ebf8a07\" class=\"colab-df-container\">\n", | |
| " <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>longitude</th>\n", | |
| " <th>latitude</th>\n", | |
| " <th>housing_median_age</th>\n", | |
| " <th>total_rooms</th>\n", | |
| " <th>total_bedrooms</th>\n", | |
| " <th>population</th>\n", | |
| " <th>households</th>\n", | |
| " <th>median_income</th>\n", | |
| " <th>median_house_value</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>-114.31</td>\n", | |
| " <td>34.19</td>\n", | |
| " <td>15.0</td>\n", | |
| " <td>5612.0</td>\n", | |
| " <td>1283.0</td>\n", | |
| " <td>1015.0</td>\n", | |
| " <td>472.0</td>\n", | |
| " <td>1.4936</td>\n", | |
| " <td>66900.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>-114.47</td>\n", | |
| " <td>34.40</td>\n", | |
| " <td>19.0</td>\n", | |
| " <td>7650.0</td>\n", | |
| " <td>1901.0</td>\n", | |
| " <td>1129.0</td>\n", | |
| " <td>463.0</td>\n", | |
| " <td>1.8200</td>\n", | |
| " <td>80100.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>-114.56</td>\n", | |
| " <td>33.69</td>\n", | |
| " <td>17.0</td>\n", | |
| " <td>720.0</td>\n", | |
| " <td>174.0</td>\n", | |
| " <td>333.0</td>\n", | |
| " <td>117.0</td>\n", | |
| " <td>1.6509</td>\n", | |
| " <td>85700.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>-114.57</td>\n", | |
| " <td>33.64</td>\n", | |
| " <td>14.0</td>\n", | |
| " <td>1501.0</td>\n", | |
| " <td>337.0</td>\n", | |
| " <td>515.0</td>\n", | |
| " <td>226.0</td>\n", | |
| " <td>3.1917</td>\n", | |
| " <td>73400.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>-114.57</td>\n", | |
| " <td>33.57</td>\n", | |
| " <td>20.0</td>\n", | |
| " <td>1454.0</td>\n", | |
| " <td>326.0</td>\n", | |
| " <td>624.0</td>\n", | |
| " <td>262.0</td>\n", | |
| " <td>1.9250</td>\n", | |
| " <td>65500.0</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", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16995</th>\n", | |
| " <td>-124.26</td>\n", | |
| " <td>40.58</td>\n", | |
| " <td>52.0</td>\n", | |
| " <td>2217.0</td>\n", | |
| " <td>394.0</td>\n", | |
| " <td>907.0</td>\n", | |
| " <td>369.0</td>\n", | |
| " <td>2.3571</td>\n", | |
| " <td>111400.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16996</th>\n", | |
| " <td>-124.27</td>\n", | |
| " <td>40.69</td>\n", | |
| " <td>36.0</td>\n", | |
| " <td>2349.0</td>\n", | |
| " <td>528.0</td>\n", | |
| " <td>1194.0</td>\n", | |
| " <td>465.0</td>\n", | |
| " <td>2.5179</td>\n", | |
| " <td>79000.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16997</th>\n", | |
| " <td>-124.30</td>\n", | |
| " <td>41.84</td>\n", | |
| " <td>17.0</td>\n", | |
| " <td>2677.0</td>\n", | |
| " <td>531.0</td>\n", | |
| " <td>1244.0</td>\n", | |
| " <td>456.0</td>\n", | |
| " <td>3.0313</td>\n", | |
| " <td>103600.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16998</th>\n", | |
| " <td>-124.30</td>\n", | |
| " <td>41.80</td>\n", | |
| " <td>19.0</td>\n", | |
| " <td>2672.0</td>\n", | |
| " <td>552.0</td>\n", | |
| " <td>1298.0</td>\n", | |
| " <td>478.0</td>\n", | |
| " <td>1.9797</td>\n", | |
| " <td>85800.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16999</th>\n", | |
| " <td>-124.35</td>\n", | |
| " <td>40.54</td>\n", | |
| " <td>52.0</td>\n", | |
| " <td>1820.0</td>\n", | |
| " <td>300.0</td>\n", | |
| " <td>806.0</td>\n", | |
| " <td>270.0</td>\n", | |
| " <td>3.0147</td>\n", | |
| " <td>94600.0</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>16164 rows × 9 columns</p>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-64f4f0b4-8ec5-4331-81f4-621a8ebf8a07')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-64f4f0b4-8ec5-4331-81f4-621a8ebf8a07 button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-64f4f0b4-8ec5-4331-81f4-621a8ebf8a07');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-cd9186c4-5253-4e9e-9988-ebfbe73c2d1e\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-cd9186c4-5253-4e9e-9988-ebfbe73c2d1e')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-cd9186c4-5253-4e9e-9988-ebfbe73c2d1e button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "summary": "{\n \"name\": \"data[condition]\",\n \"rows\": 16164,\n \"fields\": [\n {\n \"column\": \"longitude\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2.0071675974678347,\n \"min\": -124.35,\n \"max\": -114.31,\n \"num_unique_values\": 825,\n \"samples\": [\n -121.73,\n -117.35,\n -116.18\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"latitude\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2.1517950102099763,\n \"min\": 32.54,\n \"max\": 41.95,\n \"num_unique_values\": 840,\n \"samples\": [\n 38.44,\n 40.79,\n 32.69\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"housing_median_age\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 12.500903029255072,\n \"min\": 1.0,\n \"max\": 52.0,\n \"num_unique_values\": 52,\n \"samples\": [\n 23.0,\n 52.0,\n 47.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"total_rooms\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2183.312085841703,\n \"min\": 2.0,\n \"max\": 37937.0,\n \"num_unique_values\": 5397,\n \"samples\": [\n 912.0,\n 2618.0,\n 2573.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"total_bedrooms\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 424.13490735850365,\n \"min\": 2.0,\n \"max\": 6445.0,\n \"num_unique_values\": 1828,\n \"samples\": [\n 82.0,\n 905.0,\n 984.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"population\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1160.5563050390751,\n \"min\": 3.0,\n \"max\": 35682.0,\n \"num_unique_values\": 3664,\n \"samples\": [\n 2585.0,\n 895.0,\n 465.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"households\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 386.9502358418687,\n \"min\": 2.0,\n \"max\": 6082.0,\n \"num_unique_values\": 1717,\n \"samples\": [\n 902.0,\n 1252.0,\n 33.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"median_income\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.5771084524560663,\n \"min\": 0.4999,\n \"max\": 15.0001,\n \"num_unique_values\": 10531,\n \"samples\": [\n 3.6094,\n 3.5186,\n 2.1848\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"median_house_value\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 97404.06192819003,\n \"min\": 14999.0,\n \"max\": 499100.0,\n \"num_unique_values\": 3692,\n \"samples\": [\n 175300.0,\n 346800.0,\n 347700.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 56 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Filtering data by 2 column conditions\n", | |
| "condition = (data[\"median_house_value\"] < 500000) & (data[\"housing_median_age\"] > 10)\n", | |
| "data[condition]" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 444 | |
| }, | |
| "id": "IRuT3z7bOWk1", | |
| "outputId": "416ef8b9-09cc-41be-8b9f-59a11eedea81" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " longitude latitude housing_median_age total_rooms total_bedrooms \\\n", | |
| "0 -114.31 34.19 15.0 5612.0 1283.0 \n", | |
| "1 -114.47 34.40 19.0 7650.0 1901.0 \n", | |
| "2 -114.56 33.69 17.0 720.0 174.0 \n", | |
| "3 -114.57 33.64 14.0 1501.0 337.0 \n", | |
| "4 -114.57 33.57 20.0 1454.0 326.0 \n", | |
| "... ... ... ... ... ... \n", | |
| "16995 -124.26 40.58 52.0 2217.0 394.0 \n", | |
| "16996 -124.27 40.69 36.0 2349.0 528.0 \n", | |
| "16997 -124.30 41.84 17.0 2677.0 531.0 \n", | |
| "16998 -124.30 41.80 19.0 2672.0 552.0 \n", | |
| "16999 -124.35 40.54 52.0 1820.0 300.0 \n", | |
| "\n", | |
| " population households median_income median_house_value \n", | |
| "0 1015.0 472.0 1.4936 66900.0 \n", | |
| "1 1129.0 463.0 1.8200 80100.0 \n", | |
| "2 333.0 117.0 1.6509 85700.0 \n", | |
| "3 515.0 226.0 3.1917 73400.0 \n", | |
| "4 624.0 262.0 1.9250 65500.0 \n", | |
| "... ... ... ... ... \n", | |
| "16995 907.0 369.0 2.3571 111400.0 \n", | |
| "16996 1194.0 465.0 2.5179 79000.0 \n", | |
| "16997 1244.0 456.0 3.0313 103600.0 \n", | |
| "16998 1298.0 478.0 1.9797 85800.0 \n", | |
| "16999 806.0 270.0 3.0147 94600.0 \n", | |
| "\n", | |
| "[14891 rows x 9 columns]" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-abe86f48-49cc-4f3a-8aa4-4f1c8af83d9f\" class=\"colab-df-container\">\n", | |
| " <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>longitude</th>\n", | |
| " <th>latitude</th>\n", | |
| " <th>housing_median_age</th>\n", | |
| " <th>total_rooms</th>\n", | |
| " <th>total_bedrooms</th>\n", | |
| " <th>population</th>\n", | |
| " <th>households</th>\n", | |
| " <th>median_income</th>\n", | |
| " <th>median_house_value</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>-114.31</td>\n", | |
| " <td>34.19</td>\n", | |
| " <td>15.0</td>\n", | |
| " <td>5612.0</td>\n", | |
| " <td>1283.0</td>\n", | |
| " <td>1015.0</td>\n", | |
| " <td>472.0</td>\n", | |
| " <td>1.4936</td>\n", | |
| " <td>66900.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>-114.47</td>\n", | |
| " <td>34.40</td>\n", | |
| " <td>19.0</td>\n", | |
| " <td>7650.0</td>\n", | |
| " <td>1901.0</td>\n", | |
| " <td>1129.0</td>\n", | |
| " <td>463.0</td>\n", | |
| " <td>1.8200</td>\n", | |
| " <td>80100.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>-114.56</td>\n", | |
| " <td>33.69</td>\n", | |
| " <td>17.0</td>\n", | |
| " <td>720.0</td>\n", | |
| " <td>174.0</td>\n", | |
| " <td>333.0</td>\n", | |
| " <td>117.0</td>\n", | |
| " <td>1.6509</td>\n", | |
| " <td>85700.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>-114.57</td>\n", | |
| " <td>33.64</td>\n", | |
| " <td>14.0</td>\n", | |
| " <td>1501.0</td>\n", | |
| " <td>337.0</td>\n", | |
| " <td>515.0</td>\n", | |
| " <td>226.0</td>\n", | |
| " <td>3.1917</td>\n", | |
| " <td>73400.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>-114.57</td>\n", | |
| " <td>33.57</td>\n", | |
| " <td>20.0</td>\n", | |
| " <td>1454.0</td>\n", | |
| " <td>326.0</td>\n", | |
| " <td>624.0</td>\n", | |
| " <td>262.0</td>\n", | |
| " <td>1.9250</td>\n", | |
| " <td>65500.0</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", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16995</th>\n", | |
| " <td>-124.26</td>\n", | |
| " <td>40.58</td>\n", | |
| " <td>52.0</td>\n", | |
| " <td>2217.0</td>\n", | |
| " <td>394.0</td>\n", | |
| " <td>907.0</td>\n", | |
| " <td>369.0</td>\n", | |
| " <td>2.3571</td>\n", | |
| " <td>111400.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16996</th>\n", | |
| " <td>-124.27</td>\n", | |
| " <td>40.69</td>\n", | |
| " <td>36.0</td>\n", | |
| " <td>2349.0</td>\n", | |
| " <td>528.0</td>\n", | |
| " <td>1194.0</td>\n", | |
| " <td>465.0</td>\n", | |
| " <td>2.5179</td>\n", | |
| " <td>79000.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16997</th>\n", | |
| " <td>-124.30</td>\n", | |
| " <td>41.84</td>\n", | |
| " <td>17.0</td>\n", | |
| " <td>2677.0</td>\n", | |
| " <td>531.0</td>\n", | |
| " <td>1244.0</td>\n", | |
| " <td>456.0</td>\n", | |
| " <td>3.0313</td>\n", | |
| " <td>103600.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16998</th>\n", | |
| " <td>-124.30</td>\n", | |
| " <td>41.80</td>\n", | |
| " <td>19.0</td>\n", | |
| " <td>2672.0</td>\n", | |
| " <td>552.0</td>\n", | |
| " <td>1298.0</td>\n", | |
| " <td>478.0</td>\n", | |
| " <td>1.9797</td>\n", | |
| " <td>85800.0</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16999</th>\n", | |
| " <td>-124.35</td>\n", | |
| " <td>40.54</td>\n", | |
| " <td>52.0</td>\n", | |
| " <td>1820.0</td>\n", | |
| " <td>300.0</td>\n", | |
| " <td>806.0</td>\n", | |
| " <td>270.0</td>\n", | |
| " <td>3.0147</td>\n", | |
| " <td>94600.0</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>14891 rows × 9 columns</p>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-abe86f48-49cc-4f3a-8aa4-4f1c8af83d9f')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-abe86f48-49cc-4f3a-8aa4-4f1c8af83d9f button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-abe86f48-49cc-4f3a-8aa4-4f1c8af83d9f');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-dac5082f-2003-413d-ad8a-df9acb92f118\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-dac5082f-2003-413d-ad8a-df9acb92f118')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-dac5082f-2003-413d-ad8a-df9acb92f118 button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "summary": "{\n \"name\": \"data[condition]\",\n \"rows\": 14891,\n \"fields\": [\n {\n \"column\": \"longitude\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2.0065143619130774,\n \"min\": -124.35,\n \"max\": -114.31,\n \"num_unique_values\": 816,\n \"samples\": [\n -117.64,\n -118.67,\n -123.17\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"latitude\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2.153443748998928,\n \"min\": 32.55,\n \"max\": 41.95,\n \"num_unique_values\": 832,\n \"samples\": [\n 38.62,\n 40.94,\n 34.81\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"housing_median_age\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 11.240978976289389,\n \"min\": 11.0,\n \"max\": 52.0,\n \"num_unique_values\": 42,\n \"samples\": [\n 12.0,\n 31.0,\n 34.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"total_rooms\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1759.329747756432,\n \"min\": 11.0,\n \"max\": 32627.0,\n \"num_unique_values\": 4957,\n \"samples\": [\n 506.0,\n 2436.0,\n 840.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"total_bedrooms\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 368.37227521885467,\n \"min\": 3.0,\n \"max\": 6445.0,\n \"num_unique_values\": 1661,\n \"samples\": [\n 664.0,\n 1615.0,\n 376.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"population\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1020.9055131704611,\n \"min\": 3.0,\n \"max\": 35682.0,\n \"num_unique_values\": 3392,\n \"samples\": [\n 830.0,\n 1170.0,\n 4528.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"households\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 339.1833793983472,\n \"min\": 2.0,\n \"max\": 6082.0,\n \"num_unique_values\": 1560,\n \"samples\": [\n 1789.0,\n 561.0,\n 270.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"median_income\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.5443641133689376,\n \"min\": 0.4999,\n \"max\": 15.0001,\n \"num_unique_values\": 9748,\n \"samples\": [\n 4.9833,\n 5.2897,\n 3.9875\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"median_house_value\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 97972.55806775189,\n \"min\": 14999.0,\n \"max\": 499100.0,\n \"num_unique_values\": 3628,\n \"samples\": [\n 219200.0,\n 334100.0,\n 446800.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 57 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Now find rows with less than 250 households, median house value of greater than $300k, and median housing age between 10 and 40" | |
| ], | |
| "metadata": { | |
| "id": "heJxdzqZVnZM" | |
| }, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Count the unique housing median ages\n", | |
| "data[\"housing_median_age\"].value_counts()" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 1000 | |
| }, | |
| "id": "mTCkN3v5Z_mo", | |
| "outputId": "05cda7a4-4aad-479a-bef8-c10a03e3dd0f" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "housing_median_age\n", | |
| "52.0 1052\n", | |
| "36.0 715\n", | |
| "35.0 692\n", | |
| "16.0 635\n", | |
| "17.0 576\n", | |
| "34.0 567\n", | |
| "33.0 513\n", | |
| "26.0 503\n", | |
| "18.0 478\n", | |
| "25.0 461\n", | |
| "32.0 458\n", | |
| "37.0 437\n", | |
| "15.0 416\n", | |
| "19.0 412\n", | |
| "28.0 400\n", | |
| "27.0 397\n", | |
| "24.0 389\n", | |
| "31.0 384\n", | |
| "30.0 384\n", | |
| "20.0 383\n", | |
| "23.0 382\n", | |
| "29.0 374\n", | |
| "21.0 373\n", | |
| "14.0 347\n", | |
| "22.0 323\n", | |
| "38.0 318\n", | |
| "42.0 308\n", | |
| "39.0 302\n", | |
| "44.0 296\n", | |
| "43.0 286\n", | |
| "13.0 249\n", | |
| "40.0 249\n", | |
| "45.0 235\n", | |
| "41.0 232\n", | |
| "10.0 226\n", | |
| "11.0 208\n", | |
| "5.0 199\n", | |
| "46.0 196\n", | |
| "12.0 192\n", | |
| "8.0 178\n", | |
| "47.0 175\n", | |
| "9.0 172\n", | |
| "4.0 161\n", | |
| "7.0 151\n", | |
| "48.0 135\n", | |
| "6.0 129\n", | |
| "50.0 112\n", | |
| "49.0 111\n", | |
| "2.0 49\n", | |
| "3.0 46\n", | |
| "51.0 32\n", | |
| "1.0 2\n", | |
| "Name: count, dtype: int64" | |
| ], | |
| "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>count</th>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>housing_median_age</th>\n", | |
| " <th></th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>52.0</th>\n", | |
| " <td>1052</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>36.0</th>\n", | |
| " <td>715</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>35.0</th>\n", | |
| " <td>692</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>16.0</th>\n", | |
| " <td>635</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>17.0</th>\n", | |
| " <td>576</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>34.0</th>\n", | |
| " <td>567</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>33.0</th>\n", | |
| " <td>513</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>26.0</th>\n", | |
| " <td>503</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>18.0</th>\n", | |
| " <td>478</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>25.0</th>\n", | |
| " <td>461</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>32.0</th>\n", | |
| " <td>458</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>37.0</th>\n", | |
| " <td>437</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>15.0</th>\n", | |
| " <td>416</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>19.0</th>\n", | |
| " <td>412</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>28.0</th>\n", | |
| " <td>400</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>27.0</th>\n", | |
| " <td>397</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>24.0</th>\n", | |
| " <td>389</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>31.0</th>\n", | |
| " <td>384</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>30.0</th>\n", | |
| " <td>384</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>20.0</th>\n", | |
| " <td>383</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>23.0</th>\n", | |
| " <td>382</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>29.0</th>\n", | |
| " <td>374</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>21.0</th>\n", | |
| " <td>373</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>14.0</th>\n", | |
| " <td>347</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>22.0</th>\n", | |
| " <td>323</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>38.0</th>\n", | |
| " <td>318</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>42.0</th>\n", | |
| " <td>308</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>39.0</th>\n", | |
| " <td>302</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>44.0</th>\n", | |
| " <td>296</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>43.0</th>\n", | |
| " <td>286</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>13.0</th>\n", | |
| " <td>249</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>40.0</th>\n", | |
| " <td>249</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>45.0</th>\n", | |
| " <td>235</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>41.0</th>\n", | |
| " <td>232</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>10.0</th>\n", | |
| " <td>226</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>11.0</th>\n", | |
| " <td>208</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>5.0</th>\n", | |
| " <td>199</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>46.0</th>\n", | |
| " <td>196</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>12.0</th>\n", | |
| " <td>192</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>8.0</th>\n", | |
| " <td>178</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>47.0</th>\n", | |
| " <td>175</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>9.0</th>\n", | |
| " <td>172</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4.0</th>\n", | |
| " <td>161</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>7.0</th>\n", | |
| " <td>151</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>48.0</th>\n", | |
| " <td>135</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>6.0</th>\n", | |
| " <td>129</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>50.0</th>\n", | |
| " <td>112</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>49.0</th>\n", | |
| " <td>111</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2.0</th>\n", | |
| " <td>49</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3.0</th>\n", | |
| " <td>46</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>51.0</th>\n", | |
| " <td>32</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1.0</th>\n", | |
| " <td>2</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div><br><label><b>dtype:</b> int64</label>" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "execution_count": 67 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Plot the median house value\n", | |
| "data[\"median_house_value\"].hist(bins=25)\n", | |
| "plt.xlabel(\"Median House Value\")\n", | |
| "plt.ylabel(\"Count\")\n", | |
| "plt.title(\"Histogram of Median House Value in California\")" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 498 | |
| }, | |
| "id": "EQ6mLIK9ZAeJ", | |
| "outputId": "b2057b5a-6c48-466e-c314-e5d09b5c29c9" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "Text(0.5, 1.0, 'Histogram of Median House Value in California')" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "execution_count": 65 | |
| }, | |
| { | |
| "output_type": "display_data", | |
| "data": { | |
| "text/plain": [ | |
| "<Figure size 640x480 with 1 Axes>" | |
| ], | |
| "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlUAAAHPCAYAAAB6Ey8KAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABkLklEQVR4nO3deVhUVeMH8O9cNtkG1FxSUIF+ICoIuCBCqLgDSpamlmhqbqUm5Ztoilnmllvuu2larlkpSK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dql0152drbeGmHu7u4QBAF5eXkAnkxINzMzw4oVK/TOGImiWOqV0AvPSi1btgy///673rw5MzMzvfYPHjyIzMzMEtt2dnZGSkqKzqco//jjD1y4cEGnXmmPH6LqgmeqiGqofv36lVinffv2GDhwINauXYvff/8dgYGBsLCwwPXr1xEfH4+PPvoIvXr1Qp06dTBixAisXbsWY8aMQadOnXD58mUkJCSUeNbD1dUVTZo0wfz585GZmQk7Ozv8+OOPRvELd/To0YiNjcWoUaMQGRkJBwcHfPfdd0hPT8fy5culQPh///d/8PHxweLFi5GVlQUHBwfExcXpBagzZ87gk08+Qa9evdCsWTNoNBp8//33MDMzk+a1NWnSBJMmTcKiRYuQkZGBbt26wdbWFunp6Thy5Ahef/11jBw5ssS+Ozs7w9fXF0ePHgUAvVDVuXNnrFy5ElOnToWvry+uXLmC/fv365xpLE7//v3x5ZdfYuTIkejfvz/u3r2LHTt24KWXXsLDhw+leqU9foiqC4YqInquTz75BK1atcKOHTuwZMkSmJmZoXHjxujbty/8/PykepMmTYKlpSV27NiBs2fPwtvbG5s2bSrxuwQtLCywZs0aaW6RlZUVunfvjjfffBMRERGVvXvP9cILL2DHjh34/PPPsW3bNjx+/BgeHh5Ys2YNOnfurFN34cKFiImJwbp166BUKtG/f3/4+/tj+PDhUh0PDw8EBQXh+PHjyMzMhLW1NTw8PLB+/Xr4+PhI9UaPHo1mzZrhyy+/xMqVKwEADRs2RGBg4HPPLD6rT58+SEpKgre3N5o2baqzbezYscjNzcX+/fsRFxeHFi1aYO3atVi0aFGJ7bq5uWH+/PlYtmwZ5s6di5deegkLFizAgQMH8Msvv+jULe3xQ1QdKMTyzkgkIiIiIgnnVBERERHJgKGKiIiISAYMVUREREQyYKgiIiIikgFDFREREZEMGKqIiIiIZMBQRURERCQDhioiIiIiGTBUEREREcmAoYqIiIhIBgxVRERERDJgqCIiIiKSwf8D1cmtZYE+aQ4AAAAASUVORK5CYII=\n" | |
| }, | |
| "metadata": {} | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Now plot the histogram of households" | |
| ], | |
| "metadata": { | |
| "id": "bvlccAicZuTt" | |
| }, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Reading SQL Databases and more Pandas" | |
| ], | |
| "metadata": { | |
| "id": "Gbp5VFdgOSkF" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# This downloads the bible database file from https://github.com/godlytalias/Bible-Database/\n", | |
| "!wget https://github.com/godlytalias/Bible-Database/raw/refs/heads/master/English/holybible.db" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "PkK1-aQzN5zd", | |
| "outputId": "154e5d16-3baa-4969-ef1f-34839cd55de1" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "--2024-09-24 23:29:35-- https://github.com/godlytalias/Bible-Database/raw/refs/heads/master/English/holybible.db\n", | |
| "Resolving github.com (github.com)... 140.82.116.3\n", | |
| "Connecting to github.com (github.com)|140.82.116.3|:443... connected.\n", | |
| "HTTP request sent, awaiting response... 302 Found\n", | |
| "Location: https://raw.githubusercontent.com/godlytalias/Bible-Database/refs/heads/master/English/holybible.db [following]\n", | |
| "--2024-09-24 23:29:35-- https://raw.githubusercontent.com/godlytalias/Bible-Database/refs/heads/master/English/holybible.db\n", | |
| "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...\n", | |
| "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.\n", | |
| "HTTP request sent, awaiting response... 200 OK\n", | |
| "Length: 5089280 (4.9M) [application/octet-stream]\n", | |
| "Saving to: ‘holybible.db’\n", | |
| "\n", | |
| "holybible.db 100%[===================>] 4.85M --.-KB/s in 0.06s \n", | |
| "\n", | |
| "2024-09-24 23:29:35 (83.5 MB/s) - ‘holybible.db’ saved [5089280/5089280]\n", | |
| "\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "id": "YMhJ6huBNPGW" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "import sqlite3\n", | |
| "import pandas as pd\n", | |
| "\n", | |
| "path = \"holybible.db\"\n", | |
| "db = sqlite3.connect(path)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# query the first 100 verses\n", | |
| "query = \"\"\"\n", | |
| " SELECT * FROM bible limit 100\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 424 | |
| }, | |
| "id": "83Yov0oMOL_Y", | |
| "outputId": "562df8b8-5028-456a-e83f-1ff3a0976d81" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " Book Chapter Versecount \\\n", | |
| "0 0 1 1 \n", | |
| "1 0 1 2 \n", | |
| "2 0 1 3 \n", | |
| "3 0 1 4 \n", | |
| "4 0 1 5 \n", | |
| ".. ... ... ... \n", | |
| "95 0 4 16 \n", | |
| "96 0 4 17 \n", | |
| "97 0 4 18 \n", | |
| "98 0 4 19 \n", | |
| "99 0 4 20 \n", | |
| "\n", | |
| " verse \n", | |
| "0 In the beginning God created the heaven and th... \n", | |
| "1 And the earth was without form, and void; and ... \n", | |
| "2 And God said, Let there be light: and there wa... \n", | |
| "3 And God saw the light, that it was good: and G... \n", | |
| "4 And God called the light Day, and the darkness... \n", | |
| ".. ... \n", | |
| "95 And Cain went out from the presence of the LOR... \n", | |
| "96 And Cain knew his wife; and she conceived, and... \n", | |
| "97 And unto Enoch was born Irad: and Irad brings ... \n", | |
| "98 And Lamech took unto him two wives: the name o... \n", | |
| "99 And Adah bare Jabal: he was the father of such... \n", | |
| "\n", | |
| "[100 rows x 4 columns]" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-cb0d45b5-a6b6-4fab-be9c-93a8a3fd6b22\" class=\"colab-df-container\">\n", | |
| " <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>Book</th>\n", | |
| " <th>Chapter</th>\n", | |
| " <th>Versecount</th>\n", | |
| " <th>verse</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>1</td>\n", | |
| " <td>In the beginning God created the heaven and th...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>2</td>\n", | |
| " <td>And the earth was without form, and void; and ...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>3</td>\n", | |
| " <td>And God said, Let there be light: and there wa...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>4</td>\n", | |
| " <td>And God saw the light, that it was good: and G...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>5</td>\n", | |
| " <td>And God called the light Day, and the darkness...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>...</th>\n", | |
| " <td>...</td>\n", | |
| " <td>...</td>\n", | |
| " <td>...</td>\n", | |
| " <td>...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>95</th>\n", | |
| " <td>0</td>\n", | |
| " <td>4</td>\n", | |
| " <td>16</td>\n", | |
| " <td>And Cain went out from the presence of the LOR...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>96</th>\n", | |
| " <td>0</td>\n", | |
| " <td>4</td>\n", | |
| " <td>17</td>\n", | |
| " <td>And Cain knew his wife; and she conceived, and...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>97</th>\n", | |
| " <td>0</td>\n", | |
| " <td>4</td>\n", | |
| " <td>18</td>\n", | |
| " <td>And unto Enoch was born Irad: and Irad brings ...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>98</th>\n", | |
| " <td>0</td>\n", | |
| " <td>4</td>\n", | |
| " <td>19</td>\n", | |
| " <td>And Lamech took unto him two wives: the name o...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>99</th>\n", | |
| " <td>0</td>\n", | |
| " <td>4</td>\n", | |
| " <td>20</td>\n", | |
| " <td>And Adah bare Jabal: he was the father of such...</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>100 rows × 4 columns</p>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-cb0d45b5-a6b6-4fab-be9c-93a8a3fd6b22')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-cb0d45b5-a6b6-4fab-be9c-93a8a3fd6b22 button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-cb0d45b5-a6b6-4fab-be9c-93a8a3fd6b22');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-110bf0cf-081a-443f-be34-e1a179d448bb\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-110bf0cf-081a-443f-be34-e1a179d448bb')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-110bf0cf-081a-443f-be34-e1a179d448bb button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " <div id=\"id_a3a14fbd-2f93-42e4-91cd-880f075978f0\">\n", | |
| " <style>\n", | |
| " .colab-df-generate {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-generate:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('data')\"\n", | |
| " title=\"Generate code using this dataframe.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| " <script>\n", | |
| " (() => {\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#id_a3a14fbd-2f93-42e4-91cd-880f075978f0 button.colab-df-generate');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " buttonEl.onclick = () => {\n", | |
| " google.colab.notebook.generateWithVariable('data');\n", | |
| " }\n", | |
| " })();\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 100,\n \"fields\": [\n {\n \"column\": \"Book\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 0,\n \"num_unique_values\": 1,\n \"samples\": [\n 0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Chapter\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 1,\n \"max\": 4,\n \"num_unique_values\": 4,\n \"samples\": [\n 2\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Versecount\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 7,\n \"min\": 1,\n \"max\": 31,\n \"num_unique_values\": 31,\n \"samples\": [\n 28\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"verse\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 100,\n \"samples\": [\n \"And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 47 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# query the first 100 verses, only the verses\n", | |
| "query = \"\"\"\n", | |
| " SELECT verse FROM bible limit 100\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 424 | |
| }, | |
| "id": "vLkdUL2_X7ic", | |
| "outputId": "68f76c95-c854-4d85-b837-1150c74317eb" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " verse\n", | |
| "0 In the beginning God created the heaven and th...\n", | |
| "1 And the earth was without form, and void; and ...\n", | |
| "2 And God said, Let there be light: and there wa...\n", | |
| "3 And God saw the light, that it was good: and G...\n", | |
| "4 And God called the light Day, and the darkness...\n", | |
| ".. ...\n", | |
| "95 And Cain went out from the presence of the LOR...\n", | |
| "96 And Cain knew his wife; and she conceived, and...\n", | |
| "97 And unto Enoch was born Irad: and Irad brings ...\n", | |
| "98 And Lamech took unto him two wives: the name o...\n", | |
| "99 And Adah bare Jabal: he was the father of such...\n", | |
| "\n", | |
| "[100 rows x 1 columns]" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-77d630b6-6367-430f-8292-da1d17620890\" class=\"colab-df-container\">\n", | |
| " <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>verse</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>In the beginning God created the heaven and th...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>And the earth was without form, and void; and ...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>And God said, Let there be light: and there wa...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>And God saw the light, that it was good: and G...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>And God called the light Day, and the darkness...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>...</th>\n", | |
| " <td>...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>95</th>\n", | |
| " <td>And Cain went out from the presence of the LOR...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>96</th>\n", | |
| " <td>And Cain knew his wife; and she conceived, and...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>97</th>\n", | |
| " <td>And unto Enoch was born Irad: and Irad brings ...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>98</th>\n", | |
| " <td>And Lamech took unto him two wives: the name o...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>99</th>\n", | |
| " <td>And Adah bare Jabal: he was the father of such...</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>100 rows × 1 columns</p>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-77d630b6-6367-430f-8292-da1d17620890')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-77d630b6-6367-430f-8292-da1d17620890 button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-77d630b6-6367-430f-8292-da1d17620890');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-03007711-64e1-45ad-a22b-93a3d81a97ab\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-03007711-64e1-45ad-a22b-93a3d81a97ab')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-03007711-64e1-45ad-a22b-93a3d81a97ab button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " <div id=\"id_fe10de9a-8db3-4e38-8403-007d918a9542\">\n", | |
| " <style>\n", | |
| " .colab-df-generate {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-generate:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('data')\"\n", | |
| " title=\"Generate code using this dataframe.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| " <script>\n", | |
| " (() => {\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#id_fe10de9a-8db3-4e38-8403-007d918a9542 button.colab-df-generate');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " buttonEl.onclick = () => {\n", | |
| " google.colab.notebook.generateWithVariable('data');\n", | |
| " }\n", | |
| " })();\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 100,\n \"fields\": [\n {\n \"column\": \"verse\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 100,\n \"samples\": [\n \"And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:\",\n \"And Adam said, This is now bone of my bones, and flesh of my flesh: she shall be called Woman, because she was taken out of Man.\",\n \"And I will put enmity between you and the woman, and between your seed and her seed; it shall bruise your head, and you shall bruise his heel.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 49 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# query only verses from genesis\n", | |
| "query = \"\"\"\n", | |
| " SELECT * FROM bible\n", | |
| " WHERE book = 0\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 424 | |
| }, | |
| "id": "6xiJqrK0XxrM", | |
| "outputId": "66890154-9bcf-4f37-b477-787277d6ae71" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " Book Chapter Versecount \\\n", | |
| "0 0 1 1 \n", | |
| "1 0 1 2 \n", | |
| "2 0 1 3 \n", | |
| "3 0 1 4 \n", | |
| "4 0 1 5 \n", | |
| "... ... ... ... \n", | |
| "1528 0 50 22 \n", | |
| "1529 0 50 23 \n", | |
| "1530 0 50 24 \n", | |
| "1531 0 50 25 \n", | |
| "1532 0 50 26 \n", | |
| "\n", | |
| " verse \n", | |
| "0 In the beginning God created the heaven and th... \n", | |
| "1 And the earth was without form, and void; and ... \n", | |
| "2 And God said, Let there be light: and there wa... \n", | |
| "3 And God saw the light, that it was good: and G... \n", | |
| "4 And God called the light Day, and the darkness... \n", | |
| "... ... \n", | |
| "1528 And Joseph dwelt in Egypt, he, and his father'... \n", | |
| "1529 And Joseph saw Ephraim's children of the third... \n", | |
| "1530 And Joseph said unto his brethren, I die: and ... \n", | |
| "1531 And Joseph took an oath of the children of Isr... \n", | |
| "1532 So Joseph died, being an hundred and ten years... \n", | |
| "\n", | |
| "[1533 rows x 4 columns]" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-81fc1a45-fe3b-416e-af81-ee002c72c4e7\" class=\"colab-df-container\">\n", | |
| " <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>Book</th>\n", | |
| " <th>Chapter</th>\n", | |
| " <th>Versecount</th>\n", | |
| " <th>verse</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>1</td>\n", | |
| " <td>In the beginning God created the heaven and th...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>2</td>\n", | |
| " <td>And the earth was without form, and void; and ...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>3</td>\n", | |
| " <td>And God said, Let there be light: and there wa...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>4</td>\n", | |
| " <td>And God saw the light, that it was good: and G...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>0</td>\n", | |
| " <td>1</td>\n", | |
| " <td>5</td>\n", | |
| " <td>And God called the light Day, and the darkness...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>...</th>\n", | |
| " <td>...</td>\n", | |
| " <td>...</td>\n", | |
| " <td>...</td>\n", | |
| " <td>...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1528</th>\n", | |
| " <td>0</td>\n", | |
| " <td>50</td>\n", | |
| " <td>22</td>\n", | |
| " <td>And Joseph dwelt in Egypt, he, and his father'...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1529</th>\n", | |
| " <td>0</td>\n", | |
| " <td>50</td>\n", | |
| " <td>23</td>\n", | |
| " <td>And Joseph saw Ephraim's children of the third...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1530</th>\n", | |
| " <td>0</td>\n", | |
| " <td>50</td>\n", | |
| " <td>24</td>\n", | |
| " <td>And Joseph said unto his brethren, I die: and ...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1531</th>\n", | |
| " <td>0</td>\n", | |
| " <td>50</td>\n", | |
| " <td>25</td>\n", | |
| " <td>And Joseph took an oath of the children of Isr...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1532</th>\n", | |
| " <td>0</td>\n", | |
| " <td>50</td>\n", | |
| " <td>26</td>\n", | |
| " <td>So Joseph died, being an hundred and ten years...</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>1533 rows × 4 columns</p>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-81fc1a45-fe3b-416e-af81-ee002c72c4e7')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-81fc1a45-fe3b-416e-af81-ee002c72c4e7 button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-81fc1a45-fe3b-416e-af81-ee002c72c4e7');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-83f19226-46e9-4f5d-b212-54775414f5dd\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-83f19226-46e9-4f5d-b212-54775414f5dd')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-83f19226-46e9-4f5d-b212-54775414f5dd button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " <div id=\"id_922e55b4-f7f5-4ab9-be68-d2465ff91582\">\n", | |
| " <style>\n", | |
| " .colab-df-generate {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-generate:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('data')\"\n", | |
| " title=\"Generate code using this dataframe.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| " <script>\n", | |
| " (() => {\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#id_922e55b4-f7f5-4ab9-be68-d2465ff91582 button.colab-df-generate');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " buttonEl.onclick = () => {\n", | |
| " google.colab.notebook.generateWithVariable('data');\n", | |
| " }\n", | |
| " })();\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 1533,\n \"fields\": [\n {\n \"column\": \"Book\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 0,\n \"num_unique_values\": 1,\n \"samples\": [\n 0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Chapter\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 13,\n \"min\": 1,\n \"max\": 50,\n \"num_unique_values\": 50,\n \"samples\": [\n 14\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Versecount\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 11,\n \"min\": 1,\n \"max\": 67,\n \"num_unique_values\": 67,\n \"samples\": [\n 37\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"verse\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 1533,\n \"samples\": [\n \"I will pass through all your flock to day, removing from thence all the speckled and spotted cattle, and all the brown cattle among the sheep, and the spotted and speckled among the goats: and of such shall be my hire.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 50 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# query only the first verse from each book\n", | |
| "query = \"\"\"\n", | |
| "\n", | |
| "\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "id": "QEXr_vT1YHMS" | |
| }, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Get the unique values in the Book column\n", | |
| "query = \"\"\"\n", | |
| " SELECT DISTINCT(Chapter) FROM bible\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 424 | |
| }, | |
| "id": "nmt5IYVwYPwe", | |
| "outputId": "4891b3eb-c442-4f50-d25f-75aa6fb62262" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " Chapter\n", | |
| "0 1\n", | |
| "1 2\n", | |
| "2 3\n", | |
| "3 4\n", | |
| "4 5\n", | |
| ".. ...\n", | |
| "145 146\n", | |
| "146 147\n", | |
| "147 148\n", | |
| "148 149\n", | |
| "149 150\n", | |
| "\n", | |
| "[150 rows x 1 columns]" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-28586c35-2628-4a40-a72e-458ff116e997\" class=\"colab-df-container\">\n", | |
| " <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>Chapter</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>1</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>2</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>3</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>4</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>5</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>...</th>\n", | |
| " <td>...</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>145</th>\n", | |
| " <td>146</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>146</th>\n", | |
| " <td>147</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>147</th>\n", | |
| " <td>148</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>148</th>\n", | |
| " <td>149</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>149</th>\n", | |
| " <td>150</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "<p>150 rows × 1 columns</p>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-28586c35-2628-4a40-a72e-458ff116e997')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-28586c35-2628-4a40-a72e-458ff116e997 button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-28586c35-2628-4a40-a72e-458ff116e997');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| "<div id=\"df-8d6441bb-8b0f-47a8-b77f-3d7c16ec928b\">\n", | |
| " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-8d6441bb-8b0f-47a8-b77f-3d7c16ec928b')\"\n", | |
| " title=\"Suggest charts\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <g>\n", | |
| " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", | |
| " </g>\n", | |
| "</svg>\n", | |
| " </button>\n", | |
| "\n", | |
| "<style>\n", | |
| " .colab-df-quickchart {\n", | |
| " --bg-color: #E8F0FE;\n", | |
| " --fill-color: #1967D2;\n", | |
| " --hover-bg-color: #E2EBFA;\n", | |
| " --hover-fill-color: #174EA6;\n", | |
| " --disabled-fill-color: #AAA;\n", | |
| " --disabled-bg-color: #DDD;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-quickchart {\n", | |
| " --bg-color: #3B4455;\n", | |
| " --fill-color: #D2E3FC;\n", | |
| " --hover-bg-color: #434B5C;\n", | |
| " --hover-fill-color: #FFFFFF;\n", | |
| " --disabled-bg-color: #3B4455;\n", | |
| " --disabled-fill-color: #666;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart {\n", | |
| " background-color: var(--bg-color);\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: var(--fill-color);\n", | |
| " height: 32px;\n", | |
| " padding: 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart:hover {\n", | |
| " background-color: var(--hover-bg-color);\n", | |
| " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: var(--button-hover-fill-color);\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-quickchart-complete:disabled,\n", | |
| " .colab-df-quickchart-complete:disabled:hover {\n", | |
| " background-color: var(--disabled-bg-color);\n", | |
| " fill: var(--disabled-fill-color);\n", | |
| " box-shadow: none;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-spinner {\n", | |
| " border: 2px solid var(--fill-color);\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " animation:\n", | |
| " spin 1s steps(1) infinite;\n", | |
| " }\n", | |
| "\n", | |
| " @keyframes spin {\n", | |
| " 0% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " }\n", | |
| " 20% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 30% {\n", | |
| " border-color: transparent;\n", | |
| " border-left-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 40% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-top-color: var(--fill-color);\n", | |
| " }\n", | |
| " 60% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " }\n", | |
| " 80% {\n", | |
| " border-color: transparent;\n", | |
| " border-right-color: var(--fill-color);\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " 90% {\n", | |
| " border-color: transparent;\n", | |
| " border-bottom-color: var(--fill-color);\n", | |
| " }\n", | |
| " }\n", | |
| "</style>\n", | |
| "\n", | |
| " <script>\n", | |
| " async function quickchart(key) {\n", | |
| " const quickchartButtonEl =\n", | |
| " document.querySelector('#' + key + ' button');\n", | |
| " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", | |
| " quickchartButtonEl.classList.add('colab-df-spinner');\n", | |
| " try {\n", | |
| " const charts = await google.colab.kernel.invokeFunction(\n", | |
| " 'suggestCharts', [key], {});\n", | |
| " } catch (error) {\n", | |
| " console.error('Error during call to suggestCharts:', error);\n", | |
| " }\n", | |
| " quickchartButtonEl.classList.remove('colab-df-spinner');\n", | |
| " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", | |
| " }\n", | |
| " (() => {\n", | |
| " let quickchartButtonEl =\n", | |
| " document.querySelector('#df-8d6441bb-8b0f-47a8-b77f-3d7c16ec928b button');\n", | |
| " quickchartButtonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| " })();\n", | |
| " </script>\n", | |
| "</div>\n", | |
| "\n", | |
| " <div id=\"id_97e08565-296f-4be6-9ea4-d4581c407940\">\n", | |
| " <style>\n", | |
| " .colab-df-generate {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-generate:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('data')\"\n", | |
| " title=\"Generate code using this dataframe.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| " <script>\n", | |
| " (() => {\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#id_97e08565-296f-4be6-9ea4-d4581c407940 button.colab-df-generate');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " buttonEl.onclick = () => {\n", | |
| " google.colab.notebook.generateWithVariable('data');\n", | |
| " }\n", | |
| " })();\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 150,\n \"fields\": [\n {\n \"column\": \"Chapter\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 43,\n \"min\": 1,\n \"max\": 150,\n \"num_unique_values\": 150,\n \"samples\": [\n 74,\n 19,\n 119\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 51 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Count how many total verses there are in the bible\n", | |
| "query = \"\"\"\n", | |
| " SELECT COUNT(*) FROM bible\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 89 | |
| }, | |
| "id": "QqvIdW3PYZOd", | |
| "outputId": "3c4695eb-178b-4769-be18-de81fc71bcbc" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " COUNT(*)\n", | |
| "0 31102" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-99c10615-3376-4236-a152-ef73a4b749fe\" class=\"colab-df-container\">\n", | |
| " <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>COUNT(*)</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>31102</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-99c10615-3376-4236-a152-ef73a4b749fe')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-99c10615-3376-4236-a152-ef73a4b749fe button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-99c10615-3376-4236-a152-ef73a4b749fe');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| " <div id=\"id_79915e00-dd7b-4a5f-8364-389d84e4f245\">\n", | |
| " <style>\n", | |
| " .colab-df-generate {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-generate:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('data')\"\n", | |
| " title=\"Generate code using this dataframe.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| " <script>\n", | |
| " (() => {\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#id_79915e00-dd7b-4a5f-8364-389d84e4f245 button.colab-df-generate');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " buttonEl.onclick = () => {\n", | |
| " google.colab.notebook.generateWithVariable('data');\n", | |
| " }\n", | |
| " })();\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 1,\n \"fields\": [\n {\n \"column\": \"COUNT(*)\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": null,\n \"min\": 31102,\n \"max\": 31102,\n \"num_unique_values\": 1,\n \"samples\": [\n 31102\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 52 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Count how many unique books there are in the bible\n", | |
| "query = \"\"\"\n", | |
| " SELECT COUNT(DISTINCT(Book)) FROM bible\n", | |
| "\"\"\"\n", | |
| "data = pd.read_sql_query(query, db)\n", | |
| "data" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 89 | |
| }, | |
| "id": "BjItvjYlYvh1", | |
| "outputId": "14d2dfb6-9fdc-4041-c23d-4e0314d02791" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| " COUNT(DISTINCT(Book))\n", | |
| "0 66" | |
| ], | |
| "text/html": [ | |
| "\n", | |
| " <div id=\"df-9ecbd251-d868-485a-8679-26c662f02c2f\" class=\"colab-df-container\">\n", | |
| " <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>COUNT(DISTINCT(Book))</th>\n", | |
| " </tr>\n", | |
| " </thead>\n", | |
| " <tbody>\n", | |
| " <tr>\n", | |
| " <th>0</th>\n", | |
| " <td>66</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>\n", | |
| " <div class=\"colab-df-buttons\">\n", | |
| "\n", | |
| " <div class=\"colab-df-container\">\n", | |
| " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-9ecbd251-d868-485a-8679-26c662f02c2f')\"\n", | |
| " title=\"Convert this dataframe to an interactive table.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", | |
| " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| "\n", | |
| " <style>\n", | |
| " .colab-df-container {\n", | |
| " display:flex;\n", | |
| " gap: 12px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-convert:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-buttons div {\n", | |
| " margin-bottom: 4px;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-convert:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| "\n", | |
| " <script>\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#df-9ecbd251-d868-485a-8679-26c662f02c2f button.colab-df-convert');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " async function convertToInteractive(key) {\n", | |
| " const element = document.querySelector('#df-9ecbd251-d868-485a-8679-26c662f02c2f');\n", | |
| " const dataTable =\n", | |
| " await google.colab.kernel.invokeFunction('convertToInteractive',\n", | |
| " [key], {});\n", | |
| " if (!dataTable) return;\n", | |
| "\n", | |
| " const docLinkHtml = 'Like what you see? Visit the ' +\n", | |
| " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", | |
| " + ' to learn more about interactive tables.';\n", | |
| " element.innerHTML = '';\n", | |
| " dataTable['output_type'] = 'display_data';\n", | |
| " await google.colab.output.renderOutput(dataTable, element);\n", | |
| " const docLink = document.createElement('div');\n", | |
| " docLink.innerHTML = docLinkHtml;\n", | |
| " element.appendChild(docLink);\n", | |
| " }\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| "\n", | |
| " <div id=\"id_db66d8b1-7d30-42ee-9838-eca4f48fd6b4\">\n", | |
| " <style>\n", | |
| " .colab-df-generate {\n", | |
| " background-color: #E8F0FE;\n", | |
| " border: none;\n", | |
| " border-radius: 50%;\n", | |
| " cursor: pointer;\n", | |
| " display: none;\n", | |
| " fill: #1967D2;\n", | |
| " height: 32px;\n", | |
| " padding: 0 0 0 0;\n", | |
| " width: 32px;\n", | |
| " }\n", | |
| "\n", | |
| " .colab-df-generate:hover {\n", | |
| " background-color: #E2EBFA;\n", | |
| " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", | |
| " fill: #174EA6;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate {\n", | |
| " background-color: #3B4455;\n", | |
| " fill: #D2E3FC;\n", | |
| " }\n", | |
| "\n", | |
| " [theme=dark] .colab-df-generate:hover {\n", | |
| " background-color: #434B5C;\n", | |
| " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", | |
| " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", | |
| " fill: #FFFFFF;\n", | |
| " }\n", | |
| " </style>\n", | |
| " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('data')\"\n", | |
| " title=\"Generate code using this dataframe.\"\n", | |
| " style=\"display:none;\">\n", | |
| "\n", | |
| " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", | |
| " width=\"24px\">\n", | |
| " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n", | |
| " </svg>\n", | |
| " </button>\n", | |
| " <script>\n", | |
| " (() => {\n", | |
| " const buttonEl =\n", | |
| " document.querySelector('#id_db66d8b1-7d30-42ee-9838-eca4f48fd6b4 button.colab-df-generate');\n", | |
| " buttonEl.style.display =\n", | |
| " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", | |
| "\n", | |
| " buttonEl.onclick = () => {\n", | |
| " google.colab.notebook.generateWithVariable('data');\n", | |
| " }\n", | |
| " })();\n", | |
| " </script>\n", | |
| " </div>\n", | |
| "\n", | |
| " </div>\n", | |
| " </div>\n" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "dataframe", | |
| "variable_name": "data", | |
| "summary": "{\n \"name\": \"data\",\n \"rows\": 1,\n \"fields\": [\n {\n \"column\": \"COUNT(DISTINCT(Book))\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": null,\n \"min\": 66,\n \"max\": 66,\n \"num_unique_values\": 1,\n \"samples\": [\n 66\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 53 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Parallel Processing with `multiprocessing`" | |
| ], | |
| "metadata": { | |
| "id": "Gj9gwixdOMzv" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "!wget https://huggingface.co/datasets/eugenesiow/BSD100/resolve/main/data/BSD100_HR.tar.gz\n", | |
| "!tar -xvf BSD100_HR.tar.gz\n", | |
| "!rm BSD100_HR.tar.gz" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "collapsed": true, | |
| "id": "aQK06V0-NW6k", | |
| "outputId": "8711fe80-0164-4100-caf4-c06ccbf4b705" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "--2024-09-24 23:00:11-- https://huggingface.co/datasets/eugenesiow/BSD100/resolve/main/data/BSD100_HR.tar.gz\n", | |
| "Resolving huggingface.co (huggingface.co)... 3.163.189.90, 3.163.189.114, 3.163.189.74, ...\n", | |
| "Connecting to huggingface.co (huggingface.co)|3.163.189.90|:443... connected.\n", | |
| "HTTP request sent, awaiting response... 302 Found\n", | |
| "Location: https://cdn-lfs.huggingface.co/datasets/eugenesiow/BSD100/333495ccded04a0db52b33361140821ea7e0d8af8dfb54b58df79a00010858d6?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27BSD100_HR.tar.gz%3B+filename%3D%22BSD100_HR.tar.gz%22%3B&response-content-type=application%2Fgzip&Expires=1727478011&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcyNzQ3ODAxMX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9kYXRhc2V0cy9ldWdlbmVzaW93L0JTRDEwMC8zMzM0OTVjY2RlZDA0YTBkYjUyYjMzMzYxMTQwODIxZWE3ZTBkOGFmOGRmYjU0YjU4ZGY3OWEwMDAxMDg1OGQ2P3Jlc3BvbnNlLWNvbnRlbnQtZGlzcG9zaXRpb249KiZyZXNwb25zZS1jb250ZW50LXR5cGU9KiJ9XX0_&Signature=gTSSE2IejPFo2QpzuydUCX2eYYcFfRjXPRdCk3XW49kR0KJzKYcyoZrzI09cFz79E9vCgrGM5Ho8nNStdoOSBFMrWBowg6D3BM5%7EZLCXOGWX0annuyQu7SlTpYMraCASXSYki4gknVvnE60J-zyLEmxEq3N-rtApRmnHuZTwXt317Cgy%7ERG2Wsp3BreuPTHUDqfrhD9CXoiB5V0B65nUoGG7Bg2VW1a7fNf1R53h9ttoQ3uK-KO1FMz4vS22O82Vk9HyVICB6p1UNgSZFm-drYLoaiZxUgzWIqOH5TdEclnAbgKyQBjRS1LPWYbg8OmkrGVVczc30fqWK32QN3j39Q__&Key-Pair-Id=K3ESJI6DHPFC7 [following]\n", | |
| "--2024-09-24 23:00:11-- https://cdn-lfs.huggingface.co/datasets/eugenesiow/BSD100/333495ccded04a0db52b33361140821ea7e0d8af8dfb54b58df79a00010858d6?response-content-disposition=inline%3B+filename*%3DUTF-8%27%27BSD100_HR.tar.gz%3B+filename%3D%22BSD100_HR.tar.gz%22%3B&response-content-type=application%2Fgzip&Expires=1727478011&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcyNzQ3ODAxMX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9kYXRhc2V0cy9ldWdlbmVzaW93L0JTRDEwMC8zMzM0OTVjY2RlZDA0YTBkYjUyYjMzMzYxMTQwODIxZWE3ZTBkOGFmOGRmYjU0YjU4ZGY3OWEwMDAxMDg1OGQ2P3Jlc3BvbnNlLWNvbnRlbnQtZGlzcG9zaXRpb249KiZyZXNwb25zZS1jb250ZW50LXR5cGU9KiJ9XX0_&Signature=gTSSE2IejPFo2QpzuydUCX2eYYcFfRjXPRdCk3XW49kR0KJzKYcyoZrzI09cFz79E9vCgrGM5Ho8nNStdoOSBFMrWBowg6D3BM5%7EZLCXOGWX0annuyQu7SlTpYMraCASXSYki4gknVvnE60J-zyLEmxEq3N-rtApRmnHuZTwXt317Cgy%7ERG2Wsp3BreuPTHUDqfrhD9CXoiB5V0B65nUoGG7Bg2VW1a7fNf1R53h9ttoQ3uK-KO1FMz4vS22O82Vk9HyVICB6p1UNgSZFm-drYLoaiZxUgzWIqOH5TdEclnAbgKyQBjRS1LPWYbg8OmkrGVVczc30fqWK32QN3j39Q__&Key-Pair-Id=K3ESJI6DHPFC7\n", | |
| "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 108.138.94.23, 108.138.94.122, 108.138.94.14, ...\n", | |
| "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|108.138.94.23|:443... connected.\n", | |
| "HTTP request sent, awaiting response... 200 OK\n", | |
| "Length: 27186832 (26M) [application/gzip]\n", | |
| "Saving to: ‘BSD100_HR.tar.gz.1’\n", | |
| "\n", | |
| "BSD100_HR.tar.gz.1 100%[===================>] 25.93M 97.3MB/s in 0.3s \n", | |
| "\n", | |
| "2024-09-24 23:00:12 (97.3 MB/s) - ‘BSD100_HR.tar.gz.1’ saved [27186832/27186832]\n", | |
| "\n", | |
| "BSD100_HR/\n", | |
| "BSD100_HR/101085.png\n", | |
| "BSD100_HR/101087.png\n", | |
| "BSD100_HR/102061.png\n", | |
| "BSD100_HR/103070.png\n", | |
| "BSD100_HR/105025.png\n", | |
| "BSD100_HR/106024.png\n", | |
| "BSD100_HR/108005.png\n", | |
| "BSD100_HR/108070.png\n", | |
| "BSD100_HR/108082.png\n", | |
| "BSD100_HR/109053.png\n", | |
| "BSD100_HR/119082.png\n", | |
| "BSD100_HR/12084.png\n", | |
| "BSD100_HR/123074.png\n", | |
| "BSD100_HR/126007.png\n", | |
| "BSD100_HR/130026.png\n", | |
| "BSD100_HR/134035.png\n", | |
| "BSD100_HR/14037.png\n", | |
| "BSD100_HR/143090.png\n", | |
| "BSD100_HR/145086.png\n", | |
| "BSD100_HR/147091.png\n", | |
| "BSD100_HR/148026.png\n", | |
| "BSD100_HR/148089.png\n", | |
| "BSD100_HR/156065.png\n", | |
| "BSD100_HR/157055.png\n", | |
| "BSD100_HR/159008.png\n", | |
| "BSD100_HR/160068.png\n", | |
| "BSD100_HR/16077.png\n", | |
| "BSD100_HR/163085.png\n", | |
| "BSD100_HR/167062.png\n", | |
| "BSD100_HR/167083.png\n", | |
| "BSD100_HR/170057.png\n", | |
| "BSD100_HR/175032.png\n", | |
| "BSD100_HR/175043.png\n", | |
| "BSD100_HR/182053.png\n", | |
| "BSD100_HR/189080.png\n", | |
| "BSD100_HR/19021.png\n", | |
| "BSD100_HR/196073.png\n", | |
| "BSD100_HR/197017.png\n", | |
| "BSD100_HR/208001.png\n", | |
| "BSD100_HR/210088.png\n", | |
| "BSD100_HR/21077.png\n", | |
| "BSD100_HR/216081.png\n", | |
| "BSD100_HR/219090.png\n", | |
| "BSD100_HR/220075.png\n", | |
| "BSD100_HR/223061.png\n", | |
| "BSD100_HR/227092.png\n", | |
| "BSD100_HR/229036.png\n", | |
| "BSD100_HR/236037.png\n", | |
| "BSD100_HR/24077.png\n", | |
| "BSD100_HR/241004.png\n", | |
| "BSD100_HR/241048.png\n", | |
| "BSD100_HR/253027.png\n", | |
| "BSD100_HR/253055.png\n", | |
| "BSD100_HR/260058.png\n", | |
| "BSD100_HR/271035.png\n", | |
| "BSD100_HR/285079.png\n", | |
| "BSD100_HR/291000.png\n", | |
| "BSD100_HR/295087.png\n", | |
| "BSD100_HR/296007.png\n", | |
| "BSD100_HR/296059.png\n", | |
| "BSD100_HR/299086.png\n", | |
| "BSD100_HR/300091.png\n", | |
| "BSD100_HR/302008.png\n", | |
| "BSD100_HR/304034.png\n", | |
| "BSD100_HR/304074.png\n", | |
| "BSD100_HR/306005.png\n", | |
| "BSD100_HR/3096.png\n", | |
| "BSD100_HR/33039.png\n", | |
| "BSD100_HR/351093.png\n", | |
| "BSD100_HR/361010.png\n", | |
| "BSD100_HR/37073.png\n", | |
| "BSD100_HR/376043.png\n", | |
| "BSD100_HR/38082.png\n", | |
| "BSD100_HR/38092.png\n", | |
| "BSD100_HR/385039.png\n", | |
| "BSD100_HR/41033.png\n", | |
| "BSD100_HR/41069.png\n", | |
| "BSD100_HR/42012.png\n", | |
| "BSD100_HR/42049.png\n", | |
| "BSD100_HR/43074.png\n", | |
| "BSD100_HR/45096.png\n", | |
| "BSD100_HR/54082.png\n", | |
| "BSD100_HR/55073.png\n", | |
| "BSD100_HR/58060.png\n", | |
| "BSD100_HR/62096.png\n", | |
| "BSD100_HR/65033.png\n", | |
| "BSD100_HR/66053.png\n", | |
| "BSD100_HR/69015.png\n", | |
| "BSD100_HR/69020.png\n", | |
| "BSD100_HR/69040.png\n", | |
| "BSD100_HR/76053.png\n", | |
| "BSD100_HR/78004.png\n", | |
| "BSD100_HR/8023.png\n", | |
| "BSD100_HR/85048.png\n", | |
| "BSD100_HR/86000.png\n", | |
| "BSD100_HR/86016.png\n", | |
| "BSD100_HR/86068.png\n", | |
| "BSD100_HR/87046.png\n", | |
| "BSD100_HR/89072.png\n", | |
| "BSD100_HR/97033.png\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "import os\n", | |
| "import glob\n", | |
| "import multiprocessing\n", | |
| "from multiprocessing.pool import Pool\n", | |
| "\n", | |
| "from PIL import Image\n", | |
| "from tqdm import tqdm\n", | |
| "\n", | |
| "print(\"Number of CPUs:\", multiprocessing.cpu_count())" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "Oh6OCmKyNW5C", | |
| "outputId": "ee517ffd-ebfe-4b8c-d87f-a4e75539983d" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "Number of CPUs: 2\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "images = glob.glob(\"BSD100_HR/*.png\")\n", | |
| "images" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "9p4U6Ml1Q9za", | |
| "outputId": "a4ebc28e-aac1-467b-ff13-dd7edb4fb55f" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "['BSD100_HR/361010.png',\n", | |
| " 'BSD100_HR/105025.png',\n", | |
| " 'BSD100_HR/175032.png',\n", | |
| " 'BSD100_HR/148026.png',\n", | |
| " 'BSD100_HR/130026.png',\n", | |
| " 'BSD100_HR/197017.png',\n", | |
| " 'BSD100_HR/66053.png',\n", | |
| " 'BSD100_HR/385039.png',\n", | |
| " 'BSD100_HR/43074.png',\n", | |
| " 'BSD100_HR/45096.png',\n", | |
| " 'BSD100_HR/167062.png',\n", | |
| " 'BSD100_HR/24077.png',\n", | |
| " 'BSD100_HR/106024.png',\n", | |
| " 'BSD100_HR/285079.png',\n", | |
| " 'BSD100_HR/38082.png',\n", | |
| " 'BSD100_HR/85048.png',\n", | |
| " 'BSD100_HR/87046.png',\n", | |
| " 'BSD100_HR/220075.png',\n", | |
| " 'BSD100_HR/54082.png',\n", | |
| " 'BSD100_HR/182053.png',\n", | |
| " 'BSD100_HR/108070.png',\n", | |
| " 'BSD100_HR/296059.png',\n", | |
| " 'BSD100_HR/69040.png',\n", | |
| " 'BSD100_HR/189080.png',\n", | |
| " 'BSD100_HR/219090.png',\n", | |
| " 'BSD100_HR/147091.png',\n", | |
| " 'BSD100_HR/8023.png',\n", | |
| " 'BSD100_HR/260058.png',\n", | |
| " 'BSD100_HR/69015.png',\n", | |
| " 'BSD100_HR/302008.png',\n", | |
| " 'BSD100_HR/78004.png',\n", | |
| " 'BSD100_HR/208001.png',\n", | |
| " 'BSD100_HR/65033.png',\n", | |
| " 'BSD100_HR/163085.png',\n", | |
| " 'BSD100_HR/160068.png',\n", | |
| " 'BSD100_HR/227092.png',\n", | |
| " 'BSD100_HR/101085.png',\n", | |
| " 'BSD100_HR/156065.png',\n", | |
| " 'BSD100_HR/19021.png',\n", | |
| " 'BSD100_HR/86016.png',\n", | |
| " 'BSD100_HR/148089.png',\n", | |
| " 'BSD100_HR/62096.png',\n", | |
| " 'BSD100_HR/291000.png',\n", | |
| " 'BSD100_HR/58060.png',\n", | |
| " 'BSD100_HR/304034.png',\n", | |
| " 'BSD100_HR/196073.png',\n", | |
| " 'BSD100_HR/175043.png',\n", | |
| " 'BSD100_HR/42012.png',\n", | |
| " 'BSD100_HR/351093.png',\n", | |
| " 'BSD100_HR/170057.png',\n", | |
| " 'BSD100_HR/69020.png',\n", | |
| " 'BSD100_HR/97033.png',\n", | |
| " 'BSD100_HR/229036.png',\n", | |
| " 'BSD100_HR/41033.png',\n", | |
| " 'BSD100_HR/241004.png',\n", | |
| " 'BSD100_HR/119082.png',\n", | |
| " 'BSD100_HR/33039.png',\n", | |
| " 'BSD100_HR/236037.png',\n", | |
| " 'BSD100_HR/123074.png',\n", | |
| " 'BSD100_HR/376043.png',\n", | |
| " 'BSD100_HR/103070.png',\n", | |
| " 'BSD100_HR/101087.png',\n", | |
| " 'BSD100_HR/300091.png',\n", | |
| " 'BSD100_HR/159008.png',\n", | |
| " 'BSD100_HR/271035.png',\n", | |
| " 'BSD100_HR/253055.png',\n", | |
| " 'BSD100_HR/295087.png',\n", | |
| " 'BSD100_HR/145086.png',\n", | |
| " 'BSD100_HR/102061.png',\n", | |
| " 'BSD100_HR/89072.png',\n", | |
| " 'BSD100_HR/296007.png',\n", | |
| " 'BSD100_HR/108082.png',\n", | |
| " 'BSD100_HR/143090.png',\n", | |
| " 'BSD100_HR/134035.png',\n", | |
| " 'BSD100_HR/76053.png',\n", | |
| " 'BSD100_HR/41069.png',\n", | |
| " 'BSD100_HR/14037.png',\n", | |
| " 'BSD100_HR/241048.png',\n", | |
| " 'BSD100_HR/157055.png',\n", | |
| " 'BSD100_HR/108005.png',\n", | |
| " 'BSD100_HR/21077.png',\n", | |
| " 'BSD100_HR/253027.png',\n", | |
| " 'BSD100_HR/86068.png',\n", | |
| " 'BSD100_HR/109053.png',\n", | |
| " 'BSD100_HR/304074.png',\n", | |
| " 'BSD100_HR/3096.png',\n", | |
| " 'BSD100_HR/38092.png',\n", | |
| " 'BSD100_HR/216081.png',\n", | |
| " 'BSD100_HR/223061.png',\n", | |
| " 'BSD100_HR/126007.png',\n", | |
| " 'BSD100_HR/306005.png',\n", | |
| " 'BSD100_HR/16077.png',\n", | |
| " 'BSD100_HR/37073.png',\n", | |
| " 'BSD100_HR/299086.png',\n", | |
| " 'BSD100_HR/86000.png',\n", | |
| " 'BSD100_HR/167083.png',\n", | |
| " 'BSD100_HR/42049.png',\n", | |
| " 'BSD100_HR/210088.png',\n", | |
| " 'BSD100_HR/12084.png',\n", | |
| " 'BSD100_HR/55073.png']" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "execution_count": 26 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "def resize(path):\n", | |
| " img = Image.open(path).convert(\"RGB\")\n", | |
| " img = img.resize((64, 64))\n", | |
| " img.save(path.replace(\".png\", \"_resized.png\"))\n", | |
| "\n", | |
| "\n", | |
| "pool = Pool(processes=2)\n", | |
| "prog_bar = tqdm(pool.imap_unordered(resize, images), total=len(images))\n", | |
| "for result in prog_bar:\n", | |
| " pass\n" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "b5ApbZuLRDSS", | |
| "outputId": "8f976686-4004-413c-ba59-af62e67e98fb" | |
| }, | |
| "execution_count": null, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stderr", | |
| "text": [ | |
| "100%|██████████| 100/100 [00:00<00:00, 117.80it/s]\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "### Now try resizing all images to 28,28\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "n9yKd0rwSGPz" | |
| }, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "### Now try converting all images to grayscale (replace .convert(\"RGB\") with .convert(\"L\"))\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "3p1Ra0W3SMCZ" | |
| }, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## GPU Parallelization" | |
| ], | |
| "metadata": { | |
| "id": "iOmGlo8mdaFL" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "import time\n", | |
| "import torch\n", | |
| "\n", | |
| "dim = 5000\n", | |
| "\n", | |
| "x = torch.randn(dim, dim)\n", | |
| "y = torch.randn(dim, dim)\n", | |
| "start_time = time.time()\n", | |
| "z = torch.matmul(x,y)\n", | |
| "elapsed_time = time.time() - start_time\n", | |
| "print('CPU_time = ', elapsed_time)\n", | |
| "\n", | |
| "\n", | |
| "x = torch.randn(dim, dim, device=torch.device(\"cuda:0\"))\n", | |
| "y = torch.randn(dim, dim, device=torch.device(\"cuda:0\"))\n", | |
| "start_time = time.time()\n", | |
| "z = torch.matmul(x,y)\n", | |
| "elapsed_time = time.time() - start_time\n", | |
| "print('GPU_time = ', elapsed_time)" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "bcNC9KZqdZ21", | |
| "outputId": "13c55133-f904-45cb-cacb-2029c5a64d4b" | |
| }, | |
| "execution_count": 1, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "CPU_time = 7.832552909851074\n", | |
| "GPU_time = 0.19541239738464355\n" | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment