From 7e5292ffab7291b941e5d8441f09e7548e560cc1 Mon Sep 17 00:00:00 2001 From: giswqs Date: Mon, 23 Oct 2023 13:03:16 +0000 Subject: [PATCH] deploy: 910ba0630af349db89daf6910d21b325eaf42781 --- _sources/book/duckdb/02_sql_basics.ipynb | 202 ++-- _sources/book/duckdb/03_python_api.ipynb | 58 +- _sources/book/duckdb/04_data_import.ipynb | 96 +- _sources/book/duckdb/05_data_export.ipynb | 98 +- _sources/book/duckdb/05_data_export.md | 18 +- _sources/book/duckdb/06_geometries.ipynb | 64 +- .../duckdb/07_spatial_relationships.ipynb | 480 +++++++++ .../book/duckdb/07_spatial_relationships.md | 303 ++++++ _sources/book/gee/01_introduction.ipynb | 32 +- _sources/book/gee/02_maps.ipynb | 92 +- _sources/book/gee/03_gee_data.ipynb | 226 ++--- _sources/book/gee/04_local_data.ipynb | 232 ++--- _sources/book/gee/05_data_viz.ipynb | 206 ++-- _sources/book/gee/06_data_analysis.ipynb | 392 ++++---- _sources/book/gee/07_data_export.ipynb | 146 +-- _sources/book/gee/08_cartoee.ipynb | 124 +-- _sources/book/gee/09_timelapse.ipynb | 152 +-- _sources/book/gee/10_webapps.ipynb | 48 +- _sources/book/gee/11_applications.ipynb | 196 ++-- _sources/book/labs/README.ipynb | 2 +- _sources/book/labs/lab_01.ipynb | 6 +- _sources/book/labs/lab_02.ipynb | 6 +- _sources/book/labs/lab_03.ipynb | 20 +- _sources/book/labs/lab_04.ipynb | 38 +- _sources/book/labs/lab_05.ipynb | 36 +- _sources/book/labs/lab_06.ipynb | 38 +- _sources/book/labs/lab_07.ipynb | 28 +- _sources/book/postgis/geometries.ipynb | 80 +- _sources/book/postgis/geopandas.ipynb | 118 +-- _sources/book/postgis/installation.ipynb | 36 +- _sources/book/postgis/postgis_intro.ipynb | 60 +- _sources/book/postgis/projection.ipynb | 56 +- .../book/postgis/spatial_relationships.ipynb | 44 +- _sources/book/postgis/sql_basics.ipynb | 122 +-- _sources/book/preface/instructor.ipynb | 2 +- _sources/book/preface/software.ipynb | 2 +- _sources/book/preface/syllabus.ipynb | 2 +- _sources/book/python/01_getting_started.ipynb | 44 +- .../book/python/02_variables_data_types.ipynb | 118 +-- .../book/python/03_introducing_lists.ipynb | 102 +- .../book/python/04_working_with_lists.ipynb | 126 +-- _sources/book/python/05_if_statements.ipynb | 124 +-- _sources/book/python/06_dictionaries.ipynb | 106 +- .../python/07_user_input_while_loops.ipynb | 80 +- _sources/book/python/08_functions.ipynb | 102 +- _sources/book/python/09_classes.ipynb | 50 +- .../book/python/10_files_and_exceptions.ipynb | 108 +- _sources/index.ipynb | 2 +- book/duckdb/01_duckdb_intro.html | 15 +- book/duckdb/02_sql_basics.html | 15 +- book/duckdb/03_python_api.html | 15 +- book/duckdb/04_data_import.html | 15 +- book/duckdb/05_data_export.html | 33 +- book/duckdb/06_geometries.html | 21 +- book/duckdb/07_spatial_relationships.html | 950 ++++++++++++++++++ book/gee/01_introduction.html | 15 +- book/gee/02_maps.html | 15 +- book/gee/03_gee_data.html | 15 +- book/gee/04_local_data.html | 15 +- book/gee/05_data_viz.html | 15 +- book/gee/06_data_analysis.html | 15 +- book/gee/07_data_export.html | 15 +- book/gee/08_cartoee.html | 15 +- book/gee/09_timelapse.html | 15 +- book/gee/10_webapps.html | 15 +- book/gee/11_applications.html | 15 +- book/labs/README.html | 19 +- book/labs/lab_01.html | 15 +- book/labs/lab_02.html | 15 +- book/labs/lab_03.html | 15 +- book/labs/lab_04.html | 15 +- book/labs/lab_05.html | 15 +- book/labs/lab_06.html | 15 +- book/labs/lab_07.html | 15 +- book/postgis/geometries.html | 87 +- book/postgis/geopandas.html | 77 +- book/postgis/installation.html | 41 +- book/postgis/postgis_intro.html | 51 +- book/postgis/projection.html | 57 +- book/postgis/spatial_relationships.html | 75 +- book/postgis/sql_basics.html | 129 +-- book/preface/instructor.html | 15 +- book/preface/software.html | 15 +- book/preface/syllabus.html | 15 +- book/python/01_getting_started.html | 15 +- book/python/02_variables_data_types.html | 15 +- book/python/03_introducing_lists.html | 15 +- book/python/04_working_with_lists.html | 15 +- book/python/05_if_statements.html | 15 +- book/python/06_dictionaries.html | 15 +- book/python/07_user_input_while_loops.html | 15 +- book/python/08_functions.html | 15 +- book/python/09_classes.html | 15 +- book/python/10_files_and_exceptions.html | 15 +- genindex.html | 15 +- index.html | 15 +- objects.inv | Bin 1875 -> 1889 bytes search.html | 15 +- searchindex.js | 2 +- 99 files changed, 4370 insertions(+), 2565 deletions(-) create mode 100644 _sources/book/duckdb/07_spatial_relationships.ipynb create mode 100644 _sources/book/duckdb/07_spatial_relationships.md create mode 100644 book/duckdb/07_spatial_relationships.html diff --git a/_sources/book/duckdb/02_sql_basics.ipynb b/_sources/book/duckdb/02_sql_basics.ipynb index 6fb72c9..12a75b8 100644 --- a/_sources/book/duckdb/02_sql_basics.ipynb +++ b/_sources/book/duckdb/02_sql_basics.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f34fb814", + "id": "4aee804e", "metadata": {}, "source": [ "# SQL Basics\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "4628a50c", + "id": "66d2c4ce", "metadata": {}, "source": [ "## Installation\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ee679f4c", + "id": "f5b40cea", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "bef4c505", + "id": "fc8026d0", "metadata": {}, "source": [ "## Library Import and Configuration" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "760101eb", + "id": "4db68c28", "metadata": {}, "outputs": [], "source": [ @@ -68,7 +68,7 @@ }, { "cell_type": "markdown", - "id": "9d1b1e5a", + "id": "92537c48", "metadata": {}, "source": [ "Set configurations on jupysql to directly output data to Pandas and to simplify the output that is printed to the notebook." @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b88fa6b5", + "id": "4b4d3fd6", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "94321748", + "id": "0d743bcd", "metadata": {}, "source": [ "## Connecting to DuckDB\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "09138140", + "id": "a81352c0", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "1fcfa408", + "id": "01cffc65", "metadata": {}, "source": [ " If your SQL query is one line only, you may use the `%sql` magic command. For multi-line SQL query, you may use the `%%sql` magic command." @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "193fa350", + "id": "9cce2843", "metadata": {}, "source": [ "## Install extensions" @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "fc5b4833", + "id": "a47cd0bd", "metadata": {}, "source": [ "Check available DuckDB extensions." @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a1f37b1", + "id": "a3fe3a5d", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "10650f93", + "id": "57736f3d", "metadata": {}, "source": [ "DuckDB's [httpfs extension](https://duckdb.org/docs/extensions/httpfs) allows parquet and csv files to be queried remotely over http. This is useful for querying large datasets without having to download them locally. Let's install the extension and load the extension." @@ -154,7 +154,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efb7afb0", + "id": "e522fed0", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "1bd484f5", + "id": "85dc3d14", "metadata": {}, "source": [ "## Read CSV\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e637e9df", + "id": "91ba4bf9", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38d07dd0", + "id": "0ab7b53e", "metadata": {}, "outputs": [], "source": [ @@ -200,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "2a1d8a63", + "id": "8c8e4e6d", "metadata": {}, "source": [ "## Create Table\n", @@ -211,7 +211,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ac08979", + "id": "ec8e32aa", "metadata": {}, "outputs": [], "source": [ @@ -222,7 +222,7 @@ }, { "cell_type": "markdown", - "id": "eff9e65b", + "id": "bd7cd6fd", "metadata": {}, "source": [ "Create a table named `countries` from the `countries.csv` file." @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1464c6af", + "id": "c56c3de1", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "9492aa94", + "id": "18661771", "metadata": {}, "source": [ "Display the table content in the database." @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01638717", + "id": "64ac3dfb", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8000aa28", + "id": "424d2172", "metadata": {}, "outputs": [], "source": [ @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "7ee804df", + "id": "b2b89eac", "metadata": {}, "source": [ "## The SQL SELECT statement\n", @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d04a02a3", + "id": "1f83532a", "metadata": { "tags": [ "hide-output" @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "8e374c7b", + "id": "e1ec4e28", "metadata": {}, "source": [ "To limit the number of rows returned, use the `LIMIT` keyword. For example, `SELECT * FROM cities LIMIT 10` will return only the first 10 rows." @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bd21705", + "id": "abba930c", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ }, { "cell_type": "markdown", - "id": "8511dc26", + "id": "69748a35", "metadata": {}, "source": [ "Select a subset of columns from the `cities` table and display the first 10 rows." @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be088c9c", + "id": "0ff06275", "metadata": {}, "outputs": [], "source": [ @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "2f3ae7d6", + "id": "b6b4db5b", "metadata": {}, "source": [ "To select distinct values, use the `DISTINCT` keyword. For example, `SELECT DISTINCT country FROM cities` will return only the distinct values of the `country` column." @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8ed007a", + "id": "aa24575c", "metadata": {}, "outputs": [], "source": [ @@ -362,7 +362,7 @@ }, { "cell_type": "markdown", - "id": "76af85a5", + "id": "a2e62a7e", "metadata": {}, "source": [ "To count the number of rows returned, use the `COUNT(*)` function. For example, `SELECT COUNT(*) FROM cities` will return the number of rows in the `cities` table." @@ -371,7 +371,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75f826b6", + "id": "7bfb8a21", "metadata": {}, "outputs": [], "source": [ @@ -382,7 +382,7 @@ }, { "cell_type": "markdown", - "id": "686758b8", + "id": "ff3879d7", "metadata": {}, "source": [ "To count the number of distinct values, use the `COUNT(DISTINCT column)` function. For example, `SELECT COUNT(DISTINCT country) FROM cities` will return the number of distinct values in the `country` column." @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b6a29c0", + "id": "33e61598", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "362b2939", + "id": "e7df133b", "metadata": {}, "source": [ "To calculate the maximum value, use the `MAX(column)` function. For example, `SELECT MAX(population) FROM cities` will return the maximum value in the `population` column." @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b847428", + "id": "149cbdc7", "metadata": {}, "outputs": [], "source": [ @@ -422,7 +422,7 @@ }, { "cell_type": "markdown", - "id": "a52b352d", + "id": "0ba9b6dc", "metadata": {}, "source": [ "To calculate the total value, use the `SUM(column)` function. For example, `SELECT SUM(population) FROM cities` will return the total value in the `population` column." @@ -431,7 +431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4768115a", + "id": "04a3e5f4", "metadata": {}, "outputs": [], "source": [ @@ -442,7 +442,7 @@ }, { "cell_type": "markdown", - "id": "e2cf391e", + "id": "ce1736ce", "metadata": {}, "source": [ "To calculate the average value, use the `AVG(column)` function. For example, `SELECT AVG(population) FROM cities` will return the average value in the `population` column." @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "197d9b57", + "id": "924869c3", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "8f2400f6", + "id": "131fba9b", "metadata": {}, "source": [ "To order the results, use the `ORDER BY column` clause. For example, `SELECT * FROM cities ORDER BY country` will return the rows ordered by the `country` column alphabetically." @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d495e0d", + "id": "61602fb5", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "2bfefb90", + "id": "e58cf0f7", "metadata": {}, "source": [ "To order the results in descending order, use the `ORDER BY column DESC` clause. For example, `SELECT * FROM cities ORDER BY country ASC, population DESC` will return the rows ordered by the `country` column alphabetical order and then by the `population` column in descending order." @@ -491,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d64e2a5a", + "id": "3487b437", "metadata": {}, "outputs": [], "source": [ @@ -502,7 +502,7 @@ }, { "cell_type": "markdown", - "id": "064c46a2", + "id": "d0148567", "metadata": {}, "source": [ "## The WHERE Clause\n", @@ -513,7 +513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00931edc", + "id": "6373a399", "metadata": { "tags": [ "hide-output" @@ -528,7 +528,7 @@ }, { "cell_type": "markdown", - "id": "c884a05a", + "id": "36291e21", "metadata": {}, "source": [ "You can use boolean operators such as `AND`, `OR`, `NOT` to filter records. For example, `SELECT * FROM cities WHERE country='USA' OR country='CAN'` will return the rows where the `country` column is either `USA` or `CAN`." @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "726afb65", + "id": "2ee1a010", "metadata": { "tags": [ "hide-output" @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "3945e47e", + "id": "2601c98a", "metadata": {}, "source": [ "To select US cities with a population greater than 1 million, use the following query: `SELECT * FROM cities WHERE country='USA' AND population > 1000000`." @@ -561,7 +561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef1cff51", + "id": "4cdb0b4f", "metadata": { "tags": [ "hide-output" @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "b2edd0e5", + "id": "d22a60d4", "metadata": {}, "source": [ "To select cities with the country name starting with the letter `U`, use the following query: `SELECT * FROM cities WHERE country LIKE 'U%'`." @@ -585,7 +585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d32ba32", + "id": "27f825bd", "metadata": { "tags": [ "hide-output" @@ -600,7 +600,7 @@ }, { "cell_type": "markdown", - "id": "fab9cd4f", + "id": "d1de9585", "metadata": {}, "source": [ "To select cities with the country name ending with the letter `A`, use the following query: `SELECT * FROM cities WHERE country LIKE '%A'`." @@ -609,7 +609,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ebb0906", + "id": "f61c269c", "metadata": { "tags": [ "hide-output" @@ -624,7 +624,7 @@ }, { "cell_type": "markdown", - "id": "510fa08a", + "id": "d3d36db3", "metadata": {}, "source": [ "To select cities with the country name containing the letter `S` in the middle, use the following query: `SELECT * FROM cities WHERE country LIKE '_S_'`." @@ -633,7 +633,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b03be095", + "id": "1d38b8fe", "metadata": { "tags": [ "hide-output" @@ -648,7 +648,7 @@ }, { "cell_type": "markdown", - "id": "474a450b", + "id": "cd9862d6", "metadata": {}, "source": [ "To select cities from a list of countries, use the `IN` operator. For example, `SELECT * FROM cities WHERE country IN ('USA', 'CAN')` will return the rows where the `country` column is either `USA` or `CAN`." @@ -657,7 +657,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e3404f5", + "id": "1d0736f6", "metadata": { "tags": [ "hide-output" @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "88dd59c0", + "id": "51313d65", "metadata": {}, "source": [ "To select cities with a population between 1 and 10 million, use the following query: `SELECT * FROM cities WHERE population BETWEEN 1000000 AND 10000000`." @@ -681,7 +681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56741524", + "id": "2e957716", "metadata": { "tags": [ "hide-output" @@ -696,7 +696,7 @@ }, { "cell_type": "markdown", - "id": "9c3d9333", + "id": "1757e3bc", "metadata": {}, "source": [ "## SQL Joins\n", @@ -720,7 +720,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8d2b7aa", + "id": "2e310321", "metadata": {}, "outputs": [], "source": [ @@ -732,7 +732,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f2a2a6b", + "id": "5227c132", "metadata": {}, "outputs": [], "source": [ @@ -744,7 +744,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b84e602c", + "id": "9f88f20e", "metadata": {}, "outputs": [], "source": [ @@ -756,7 +756,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a4a1cc6", + "id": "82b34cd8", "metadata": {}, "outputs": [], "source": [ @@ -767,7 +767,7 @@ }, { "cell_type": "markdown", - "id": "08cb2052", + "id": "a2d606a8", "metadata": {}, "source": [ "### SQL Inner Join\n", @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3baa3cb1", + "id": "ad12ec2e", "metadata": { "tags": [ "hide-output" @@ -793,7 +793,7 @@ }, { "cell_type": "markdown", - "id": "f1137c6a", + "id": "07644573", "metadata": {}, "source": [ "Only select the `city` and `country` columns from the `cities` table and the `Country` column from the `countries` table." @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c2ffb4d", + "id": "720f1933", "metadata": { "tags": [ "hide-output" @@ -817,7 +817,7 @@ }, { "cell_type": "markdown", - "id": "61ca19d2", + "id": "1561c981", "metadata": {}, "source": [ "### SQL Left Join\n", @@ -828,7 +828,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11753e1d", + "id": "6f0616a5", "metadata": { "tags": [ "hide-output" @@ -843,7 +843,7 @@ }, { "cell_type": "markdown", - "id": "81a553be", + "id": "852fcb84", "metadata": {}, "source": [ "### SQL Right Join\n", @@ -854,7 +854,7 @@ { "cell_type": "code", "execution_count": null, - "id": "183cb354", + "id": "1433ff90", "metadata": { "tags": [ "hide-output" @@ -869,7 +869,7 @@ }, { "cell_type": "markdown", - "id": "8838a7a2", + "id": "cbb258fd", "metadata": {}, "source": [ "### SQL Full Join\n", @@ -880,7 +880,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6525fb69", + "id": "83d9151e", "metadata": { "tags": [ "hide-output" @@ -895,7 +895,7 @@ }, { "cell_type": "markdown", - "id": "0f4575b7", + "id": "cb4837c9", "metadata": {}, "source": [ "### SQL Union\n", @@ -906,7 +906,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a06ac430", + "id": "cc0f0ed5", "metadata": { "tags": [ "hide-output" @@ -923,7 +923,7 @@ }, { "cell_type": "markdown", - "id": "a270fa16", + "id": "bfd48fc5", "metadata": {}, "source": [ "## Aggregation\n", @@ -938,7 +938,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57d602c3", + "id": "709b9154", "metadata": { "tags": [ "hide-output" @@ -957,7 +957,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74a20b4c", + "id": "89fe1998", "metadata": { "tags": [ "hide-output" @@ -976,7 +976,7 @@ }, { "cell_type": "markdown", - "id": "f43aa929", + "id": "7a6937d6", "metadata": {}, "source": [ "### Having\n", @@ -989,7 +989,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4347e9a", + "id": "080bd6d7", "metadata": {}, "outputs": [], "source": [ @@ -1005,7 +1005,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85748aeb", + "id": "3be8d2fb", "metadata": {}, "outputs": [], "source": [ @@ -1021,7 +1021,7 @@ }, { "cell_type": "markdown", - "id": "ef45ca35", + "id": "4b92a5eb", "metadata": {}, "source": [ "## Conditional statements\n", @@ -1034,7 +1034,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d3c7c11", + "id": "6f3063ab", "metadata": { "tags": [ "hide-output" @@ -1055,7 +1055,7 @@ }, { "cell_type": "markdown", - "id": "f7ec2433", + "id": "c23e12be", "metadata": {}, "source": [ "## Saving results\n", @@ -1066,7 +1066,7 @@ { "cell_type": "code", "execution_count": null, - "id": "913bb779", + "id": "732c25fd", "metadata": {}, "outputs": [], "source": [ @@ -1077,7 +1077,7 @@ }, { "cell_type": "markdown", - "id": "7e1a8ab9", + "id": "cc3ae5af", "metadata": {}, "source": [ "Show the new table content." @@ -1086,7 +1086,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea2eccf0", + "id": "ba5b9f82", "metadata": {}, "outputs": [], "source": [ @@ -1097,7 +1097,7 @@ }, { "cell_type": "markdown", - "id": "829f4b2a", + "id": "70167ad4", "metadata": {}, "source": [ "Use the `DROP TABLE` statement to delete the table." @@ -1106,7 +1106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d909edd1", + "id": "1b1119f2", "metadata": {}, "outputs": [], "source": [ @@ -1119,7 +1119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72acaefc", + "id": "65bc8a77", "metadata": {}, "outputs": [], "source": [ @@ -1130,7 +1130,7 @@ }, { "cell_type": "markdown", - "id": "4578d3d5", + "id": "ac7bbb21", "metadata": {}, "source": [ "Use the `INSERT INTO` statement to insert rows into a table." @@ -1139,7 +1139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "641a1dbf", + "id": "42352d50", "metadata": {}, "outputs": [], "source": [ @@ -1150,7 +1150,7 @@ }, { "cell_type": "markdown", - "id": "faefcab1", + "id": "bec46b30", "metadata": {}, "source": [ "## SQL Comments\n", @@ -1170,7 +1170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4880438", + "id": "cfe71bf3", "metadata": {}, "outputs": [], "source": [ @@ -1181,7 +1181,7 @@ }, { "cell_type": "markdown", - "id": "bf1f50c6", + "id": "8c653138", "metadata": {}, "source": [ "### Multi-line comments\n", @@ -1196,7 +1196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7e6b530", + "id": "a6979f2e", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/duckdb/03_python_api.ipynb b/_sources/book/duckdb/03_python_api.ipynb index ed59b9e..b5e296c 100644 --- a/_sources/book/duckdb/03_python_api.ipynb +++ b/_sources/book/duckdb/03_python_api.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1abf2a1c", + "id": "72ea7b01", "metadata": {}, "source": [ "# Python API\n", @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "835ff839", + "id": "8364358a", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "7e714954", + "id": "0468880e", "metadata": {}, "source": [ "## Library Import" @@ -46,7 +46,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6639b89", + "id": "2430acb6", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "d32e5211", + "id": "d11254a0", "metadata": {}, "source": [ "## Installing Extensions\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b5a33c7", + "id": "7ab9c396", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "e44196a4", + "id": "833394ca", "metadata": {}, "source": [ "## Data Input\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ef285ee", + "id": "7fc84575", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86009c87", + "id": "14082889", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d78359a5", + "id": "cdc2e097", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "165664d4", + "id": "18b07108", "metadata": {}, "source": [ "## DataFrames\n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6239c6e", + "id": "96f81434", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "9d99efe9", + "id": "5d0c3f03", "metadata": {}, "source": [ "DuckDB can also ingest data from remote sources (e.g., HTTP, S3) and return a Pandas DataFrame." @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a91fe6b0", + "id": "5d53a790", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "d9ac29eb", + "id": "ea17cd11", "metadata": {}, "source": [ "## Result Conversion\n", @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6ccf74e", + "id": "4a831a6e", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21007c94", + "id": "0ea814e3", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6b4aa9b", + "id": "aa2c520e", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "d71298ef", + "id": "df028e0d", "metadata": {}, "source": [ "## Writing Data to Disk\n", @@ -209,7 +209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3980e87a", + "id": "967a5b69", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "dcda042d", + "id": "1ea36df0", "metadata": {}, "source": [ "## Persistent Storage\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d740cf6", + "id": "91d493c3", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfcd409e", + "id": "bc1274e5", "metadata": {}, "outputs": [], "source": [ @@ -259,7 +259,7 @@ }, { "cell_type": "markdown", - "id": "133fbb7f", + "id": "2028d13f", "metadata": {}, "source": [ "You can also use a context manager to ensure that the connection is closed:" @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9bcc718", + "id": "5af5ee6e", "metadata": {}, "outputs": [], "source": [ @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "039534d2", + "id": "8470624e", "metadata": {}, "source": [ "## Connection Object and Module\n", @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39a0921e", + "id": "4a6f5dc7", "metadata": {}, "outputs": [], "source": [ @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b0a84d5b", + "id": "9d88c0d6", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ }, { "cell_type": "markdown", - "id": "4c3dcae0", + "id": "67cd7d9b", "metadata": {}, "source": [ "## References\n", diff --git a/_sources/book/duckdb/04_data_import.ipynb b/_sources/book/duckdb/04_data_import.ipynb index b1206be..dcd9059 100644 --- a/_sources/book/duckdb/04_data_import.ipynb +++ b/_sources/book/duckdb/04_data_import.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3cd1d1b1", + "id": "8a2c97bd", "metadata": {}, "source": [ "# Data Import\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "060bc620", + "id": "6dde11a4", "metadata": {}, "outputs": [], "source": [ @@ -34,7 +34,7 @@ }, { "cell_type": "markdown", - "id": "71020359", + "id": "b06a6f28", "metadata": {}, "source": [ "## Library Import" @@ -43,7 +43,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35c31273", + "id": "4351514d", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "ea4ce11f", + "id": "7fe70aab", "metadata": {}, "source": [ "## Installing Extensions\n", @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6956bd29", + "id": "d7a228b3", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61c9018d", + "id": "65cbaf22", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2e9def8", + "id": "4275834b", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "1de1be8b", + "id": "3ed965a0", "metadata": {}, "source": [ "## Downloading Sample Data" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4763a39", + "id": "801b8faa", "metadata": {}, "outputs": [], "source": [ @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "55eb3b1e", + "id": "742ffe7b", "metadata": {}, "source": [ "## CSV Files\n", @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ee4eca9", + "id": "be0caace", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3f797bd", + "id": "6cb83122", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47ecef2d", + "id": "8238d95c", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38deed6b", + "id": "b8f48033", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56f2b637", + "id": "6a29ce03", "metadata": {}, "outputs": [], "source": [ @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "e4c63da2", + "id": "6028a710", "metadata": {}, "source": [ "## JSON Files\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca20f438", + "id": "712f31c8", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cce32f1b", + "id": "aee7289b", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fab7ca8b", + "id": "6a152827", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "5a04bb01", + "id": "f18f9ba1", "metadata": {}, "source": [ "## DataFrames\n", @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ba5f1d9", + "id": "abe61489", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a2628b9", + "id": "135c28c8", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "204f0987", + "id": "c370c501", "metadata": {}, "source": [ "## Parquet Files\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d6a05a4", + "id": "fa1c1a98", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eff5a177", + "id": "61305501", "metadata": {}, "outputs": [], "source": [ @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea3f959c", + "id": "01ba8132", "metadata": {}, "outputs": [], "source": [ @@ -297,7 +297,7 @@ }, { "cell_type": "markdown", - "id": "503d2af1", + "id": "9f2c52aa", "metadata": {}, "source": [ "## GeoJSON Files" @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfea48dc", + "id": "71112557", "metadata": {}, "outputs": [], "source": [ @@ -316,7 +316,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e428dfd", + "id": "cff880e5", "metadata": {}, "outputs": [], "source": [ @@ -326,7 +326,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc32abe1", + "id": "754858b3", "metadata": {}, "outputs": [], "source": [ @@ -336,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2701974", + "id": "aa064673", "metadata": {}, "outputs": [], "source": [ @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90dc38a0", + "id": "7a6b62a9", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6b2aace", + "id": "6fc63e63", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "8a163b69", + "id": "7ff9a0b0", "metadata": {}, "source": [ "## Shapefiles" @@ -374,7 +374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba22d2ad", + "id": "7373fb92", "metadata": {}, "outputs": [], "source": [ @@ -384,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86cce60b", + "id": "6c7d047a", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dac49ffd", + "id": "86feefbf", "metadata": {}, "outputs": [], "source": [ @@ -409,7 +409,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2bf56f4", + "id": "5f2a964b", "metadata": {}, "outputs": [], "source": [ @@ -419,7 +419,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc4a1e6a", + "id": "54735720", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "06ef4b21", + "id": "b579294d", "metadata": {}, "source": [ "## GeoParquet Files" @@ -437,7 +437,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56ebd6c0", + "id": "f81551e2", "metadata": {}, "outputs": [], "source": [ @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54dd5887", + "id": "4a9de07a", "metadata": {}, "outputs": [], "source": [ @@ -463,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e78c2e18", + "id": "76520a0e", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18be87f6", + "id": "b27af68e", "metadata": {}, "outputs": [], "source": [ @@ -489,7 +489,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56316992", + "id": "838fb4d7", "metadata": {}, "outputs": [], "source": [ @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7adcd85", + "id": "221220f9", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "7194e868", + "id": "652bc2c8", "metadata": {}, "source": [ "## References\n", diff --git a/_sources/book/duckdb/05_data_export.ipynb b/_sources/book/duckdb/05_data_export.ipynb index 5f0ced0..dacf421 100644 --- a/_sources/book/duckdb/05_data_export.ipynb +++ b/_sources/book/duckdb/05_data_export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f97984f2", + "id": "14ff2930", "metadata": {}, "source": [ "# Data Export\n", @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b746aa63", + "id": "2a21679d", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ }, { "cell_type": "markdown", - "id": "3d9f0544", + "id": "2673a953", "metadata": {}, "source": [ "## Library Import" @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ae1f440", + "id": "451f78e2", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "835457a4", + "id": "708008c4", "metadata": {}, "source": [ "## Installing Extensions\n", @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "423b5f37", + "id": "6e7baba8", "metadata": {}, "outputs": [], "source": [ @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f60ceca", + "id": "b55898a1", "metadata": {}, "outputs": [], "source": [ @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27e7d49c", + "id": "5976ff7a", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "70c51f65", + "id": "b0cfa81f", "metadata": {}, "source": [ "## Sample Data" @@ -98,12 +98,12 @@ { "cell_type": "code", "execution_count": null, - "id": "a58e0844", + "id": "1f86d2a8", "metadata": {}, "outputs": [], "source": [ "con.sql(\n", - "\"\"\"\n", + " \"\"\"\n", "CREATE TABLE IF NOT EXISTS cities AS\n", "SELECT * EXCLUDE geometry, ST_GeomFromWKB(geometry) \n", "AS geometry FROM 'https://open.gishub.org/data/duckdb/cities.parquet'\n", @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39283da4", + "id": "54e13f2f", "metadata": {}, "outputs": [], "source": [ @@ -123,7 +123,7 @@ }, { "cell_type": "markdown", - "id": "fb715b22", + "id": "78bbf591", "metadata": {}, "source": [ "## To DataFrames" @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e50418eb", + "id": "d38c209b", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "076c9949", + "id": "6e18f3f0", "metadata": {}, "source": [ "## To CSV" @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49a424c7", + "id": "251ea977", "metadata": {}, "outputs": [], "source": [ @@ -160,16 +160,18 @@ { "cell_type": "code", "execution_count": null, - "id": "1de5e6ee", + "id": "1d87091f", "metadata": {}, "outputs": [], "source": [ - "con.sql(\"COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.csv' (HEADER, DELIMITER ',')\")" + "con.sql(\n", + " \"COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.csv' (HEADER, DELIMITER ',')\"\n", + ")" ] }, { "cell_type": "markdown", - "id": "5d48a9f0", + "id": "b4d009d1", "metadata": {}, "source": [ "## To JSON" @@ -178,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "894ac59a", + "id": "6b6fa582", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c25a668", + "id": "30bf510c", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +199,7 @@ }, { "cell_type": "markdown", - "id": "e2befe75", + "id": "8e1fbed5", "metadata": {}, "source": [ "## To Excel" @@ -206,16 +208,18 @@ { "cell_type": "code", "execution_count": null, - "id": "a6403387", + "id": "b3ed875c", "metadata": {}, "outputs": [], "source": [ - "con.sql(\"COPY (SELECT * EXCLUDE geometry FROM cities) TO 'cities.xlsx' WITH (FORMAT GDAL, DRIVER 'XLSX')\")" + "con.sql(\n", + " \"COPY (SELECT * EXCLUDE geometry FROM cities) TO 'cities.xlsx' WITH (FORMAT GDAL, DRIVER 'XLSX')\"\n", + ")" ] }, { "cell_type": "markdown", - "id": "69c92930", + "id": "cea74377", "metadata": {}, "source": [ "## To Parquet" @@ -224,7 +228,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62d4bf74", + "id": "96a2473d", "metadata": {}, "outputs": [], "source": [ @@ -234,16 +238,18 @@ { "cell_type": "code", "execution_count": null, - "id": "704c58c5", + "id": "a8f89fbf", "metadata": {}, "outputs": [], "source": [ - "con.sql(\"COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.parquet' (FORMAT PARQUET)\")" + "con.sql(\n", + " \"COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.parquet' (FORMAT PARQUET)\"\n", + ")" ] }, { "cell_type": "markdown", - "id": "9512188f", + "id": "f5ca8020", "metadata": {}, "source": [ "## To GeoJSON" @@ -252,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1045730a", + "id": "8f71e30e", "metadata": {}, "outputs": [], "source": [ @@ -262,16 +268,18 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd7121f", + "id": "be2dfedf", "metadata": {}, "outputs": [], "source": [ - "con.sql(\"COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.geojson' WITH (FORMAT GDAL, DRIVER 'GeoJSON')\")" + "con.sql(\n", + " \"COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.geojson' WITH (FORMAT GDAL, DRIVER 'GeoJSON')\"\n", + ")" ] }, { "cell_type": "markdown", - "id": "b41cc6fa", + "id": "ed8f5815", "metadata": {}, "source": [ "## To Shapefile\n", @@ -282,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "faac1511", + "id": "76bd7995", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "c01237c7", + "id": "01de7888", "metadata": {}, "source": [ "## To GeoPackage" @@ -300,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9416a9a", + "id": "161dd4a5", "metadata": {}, "outputs": [], "source": [ @@ -339,21 +347,21 @@ 73, 77, 81, - 83, - 87, - 91, + 85, + 89, 93, - 97, + 95, 99, 103, 107, - 109, - 113, - 117, + 111, + 115, 119, - 125, + 123, 127, - 131 + 133, + 135, + 139 ] }, "nbformat": 4, diff --git a/_sources/book/duckdb/05_data_export.md b/_sources/book/duckdb/05_data_export.md index f851478..ab27c65 100644 --- a/_sources/book/duckdb/05_data_export.md +++ b/_sources/book/duckdb/05_data_export.md @@ -54,7 +54,7 @@ con.load_extension("spatial") ```{code-cell} ipython3 con.sql( -""" + """ CREATE TABLE IF NOT EXISTS cities AS SELECT * EXCLUDE geometry, ST_GeomFromWKB(geometry) AS geometry FROM 'https://open.gishub.org/data/duckdb/cities.parquet' @@ -79,7 +79,9 @@ con.sql("COPY cities TO 'cities.csv' (HEADER, DELIMITER ',')") ``` ```{code-cell} ipython3 -con.sql("COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.csv' (HEADER, DELIMITER ',')") +con.sql( + "COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.csv' (HEADER, DELIMITER ',')" +) ``` ## To JSON @@ -95,7 +97,9 @@ con.sql("COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.json'") ## To Excel ```{code-cell} ipython3 -con.sql("COPY (SELECT * EXCLUDE geometry FROM cities) TO 'cities.xlsx' WITH (FORMAT GDAL, DRIVER 'XLSX')") +con.sql( + "COPY (SELECT * EXCLUDE geometry FROM cities) TO 'cities.xlsx' WITH (FORMAT GDAL, DRIVER 'XLSX')" +) ``` ## To Parquet @@ -105,7 +109,9 @@ con.sql("COPY cities TO 'cities.parquet' (FORMAT PARQUET)") ``` ```{code-cell} ipython3 -con.sql("COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.parquet' (FORMAT PARQUET)") +con.sql( + "COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.parquet' (FORMAT PARQUET)" +) ``` ## To GeoJSON @@ -115,7 +121,9 @@ con.sql("COPY cities TO 'cities.geojson' WITH (FORMAT GDAL, DRIVER 'GeoJSON')") ``` ```{code-cell} ipython3 -con.sql("COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.geojson' WITH (FORMAT GDAL, DRIVER 'GeoJSON')") +con.sql( + "COPY (SELECT * FROM cities WHERE country='USA') TO 'cities_us.geojson' WITH (FORMAT GDAL, DRIVER 'GeoJSON')" +) ``` ## To Shapefile diff --git a/_sources/book/duckdb/06_geometries.ipynb b/_sources/book/duckdb/06_geometries.ipynb index 59b8e95..355cc14 100644 --- a/_sources/book/duckdb/06_geometries.ipynb +++ b/_sources/book/duckdb/06_geometries.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9fd26c52", + "id": "fbc49e92", "metadata": {}, "source": [ "# Working with Geometries\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0833697", + "id": "72827ce4", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "70ba8c0c", + "id": "04b72325", "metadata": {}, "source": [ "## Library Import and Configuration" @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0edd4e3f", + "id": "758d915e", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "markdown", - "id": "05edff6a", + "id": "eb6fc23c", "metadata": {}, "source": [ "Set configurations on jupysql to directly output data to Pandas and to simplify the output that is printed to the notebook." @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1d6ecfe", + "id": "bd35aa08", "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "markdown", - "id": "88b6f814", + "id": "4b6bb417", "metadata": {}, "source": [ "## Sample Data" @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "269c6667", + "id": "305d2c52", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "f4b0f5d4", + "id": "51c55b43", "metadata": {}, "source": [ "## Connecting to DuckDB\n", @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "837c28cd", + "id": "dda5577a", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a57a75e", + "id": "88760a8c", "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "markdown", - "id": "52ad8be4", + "id": "a5dedd5c", "metadata": {}, "source": [ "## Creating samples" @@ -131,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e4e1d57", + "id": "ce282900", "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d71611f6", + "id": "5b95e3b5", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f6f8192", + "id": "f862f80c", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "3d04c3d5", + "id": "f7e7706c", "metadata": {}, "source": [ "## Points\n", @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6eace748", + "id": "1c8b9a31", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "eab35657", + "id": "f4f3fde7", "metadata": {}, "source": [ "Some of the specific spatial functions for working with points are:\n", @@ -215,7 +215,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3d80956", + "id": "dfb14faa", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "290a12ac", + "id": "4c8df5f3", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f036e9f", + "id": "2a5cb7ff", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "33821585", + "id": "1a46049d", "metadata": {}, "source": [ "## Linestrings\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5270a51f", + "id": "cdadd506", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "cedbb893", + "id": "b154a8ce", "metadata": {}, "source": [ "Some of the specific spatial functions for working with linestrings are:\n", @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8609caf4", + "id": "d044c3a0", "metadata": {}, "outputs": [], "source": [ @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "b9555d20", + "id": "5338d9f6", "metadata": {}, "source": [ "## Polygons" @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "afb732f4", + "id": "64ed6eed", "metadata": {}, "source": [ "![](https://postgis.net/workshops/postgis-intro/_images/polygons.png)\n", @@ -355,7 +355,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cb1b43b", + "id": "4a589f67", "metadata": {}, "outputs": [], "source": [ @@ -368,7 +368,7 @@ }, { "cell_type": "markdown", - "id": "64242b2c", + "id": "307950dd", "metadata": {}, "source": [ "Some of the specific spatial functions for working with polygons are:\n", @@ -387,7 +387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9597691", + "id": "ce50e9e2", "metadata": {}, "outputs": [], "source": [ @@ -400,7 +400,7 @@ }, { "cell_type": "markdown", - "id": "dce228fa", + "id": "b1b927c9", "metadata": {}, "source": [ "## Collections\n", @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87769bb6", + "id": "b95765b5", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/duckdb/07_spatial_relationships.ipynb b/_sources/book/duckdb/07_spatial_relationships.ipynb new file mode 100644 index 0000000..13eae05 --- /dev/null +++ b/_sources/book/duckdb/07_spatial_relationships.ipynb @@ -0,0 +1,480 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1d36cc3d", + "metadata": {}, + "source": [ + "# Spatial Relationships\n", + "\n", + "## Introduction\n", + "\n", + "## Installation\n", + "\n", + "Uncomment the following cell to install the required packages if needed." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1ce0d36e", + "metadata": {}, + "outputs": [], + "source": [ + "# %pip install duckdb duckdb-engine jupysql" + ] + }, + { + "cell_type": "markdown", + "id": "9c497740", + "metadata": {}, + "source": [ + "## Library Import and Configuration" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7768c76a", + "metadata": {}, + "outputs": [], + "source": [ + "import duckdb\n", + "import leafmap\n", + "import pandas as pd\n", + "\n", + "# Import jupysql Jupyter extension to create SQL cells\n", + "%load_ext sql" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22a82868", + "metadata": {}, + "outputs": [], + "source": [ + "%config SqlMagic.autopandas = True\n", + "%config SqlMagic.feedback = False\n", + "%config SqlMagic.displaycon = False" + ] + }, + { + "cell_type": "markdown", + "id": "cb1042f3", + "metadata": {}, + "source": [ + "## Sample Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "be22f954", + "metadata": {}, + "outputs": [], + "source": [ + "url = \"https://open.gishub.org/data/duckdb/nyc_data.db.zip\"\n", + "leafmap.download_file(url, unzip=True)" + ] + }, + { + "cell_type": "markdown", + "id": "d6b30921", + "metadata": {}, + "source": [ + "## Connecting to DuckDB\n", + "\n", + "Connect jupysql to DuckDB using a SQLAlchemy-style connection string. You may either connect to an in memory DuckDB, or a file backed db." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "55e3c406", + "metadata": {}, + "outputs": [], + "source": [ + "# %sql duckdb:///:memory:\n", + "%sql duckdb:///nyc_data.db" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4e36e8cd", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "INSTALL spatial;\n", + "LOAD spatial;" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "31a5cac2", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql \n", + "\n", + "SELECT * from nyc_subway_stations LIMIT 5" + ] + }, + { + "cell_type": "markdown", + "id": "31057bba", + "metadata": {}, + "source": [ + "## Spatial Relationships\n", + "\n", + "So far we have only used spatial functions that measure (`ST_Area`,\n", + "`ST_Length`), serialize (`ST_GeomFromText`) or deserialize (`ST_AsGML`)\n", + "geometries. What these functions have in common is that they only work\n", + "on one geometry at a time.\n", + "\n", + "Spatial databases are powerful because they not only store geometry,\n", + "they also have the ability to compare *relationships between\n", + "geometries*.\n", + "\n", + "Questions like \"Which are the closest bike racks to a park?\" or \"Where\n", + "are the intersections of subway lines and streets?\" can only be answered\n", + "by comparing geometries representing the bike racks, streets, and subway\n", + "lines.\n", + "\n", + "The OGC standard defines the following set of methods to compare\n", + "geometries." + ] + }, + { + "cell_type": "markdown", + "id": "755439d5", + "metadata": {}, + "source": [ + "## ST_Equals\n", + "\n", + "`ST_Equals(geometry A, geometry B)`tests the spatial equality of two geometries.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_equals.png)\n", + "\n", + "ST_Equals returns TRUE if two geometries of the same type have identical\n", + "x,y coordinate values, i.e. if the second shape is equal (identical) to\n", + "the first shape.\n", + "\n", + "First, let\\'s retrieve a representation of a point from our\n", + "`nyc_subway_stations` table. We\\'ll take just the entry for \\'Broad\n", + "St\\'." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "271070fd", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "SELECT name, geom, ST_AsText(geom)\n", + "FROM nyc_subway_stations\n", + "WHERE name = 'Broad St';" + ] + }, + { + "cell_type": "markdown", + "id": "baf850cf", + "metadata": {}, + "source": [ + "Then, plug the geometry representation back into an\n", + "`ST_Equals` test:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2b946d6b", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "SELECT name\n", + "FROM nyc_subway_stations\n", + "WHERE ST_Equals(geom, ST_GeomFromHEXWKB('0101000020266900000EEBD4CF27CF2141BC17D69516315141'));" + ] + }, + { + "cell_type": "markdown", + "id": "d544c6dc", + "metadata": {}, + "source": [ + "## ST_Intersects, ST_Disjoint, ST_Crosses and ST_Overlaps\n", + "\n", + "`ST_Intersects`,\n", + "`ST_Crosses`, and\n", + "`ST_Overlaps` test whether the\n", + "interiors of the geometries intersect.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_intersects.png)\n", + "\n", + "`ST_Intersects(geometry A, geometry B)` returns t (TRUE) if the two shapes have any space in\n", + "common, i.e., if their boundaries or interiors intersect.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_disjoint.png)\n", + "\n", + "The opposite of ST_Intersects is\n", + "`ST_Disjoint(geometry A , geometry B)`. If two geometries are disjoint, they do not intersect,\n", + "and vice-versa. In fact, it is often more efficient to test \\\"not\n", + "intersects\\\" than to test \\\"disjoint\\\" because the intersects tests can\n", + "be spatially indexed, while the disjoint test cannot.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_crosses.png)\n", + "\n", + "For multipoint/polygon, multipoint/linestring, linestring/linestring,\n", + "linestring/polygon, and linestring/multipolygon comparisons,\n", + "`ST_Crosses(geometry A, geometry B)`\n", + "returns t (TRUE) if the intersection results in a geometry whose\n", + "dimension is one less than the maximum dimension of the two source\n", + "geometries and the intersection set is interior to both source\n", + "geometries.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_overlaps.png)\n", + "\n", + "`ST_Overlaps(geometry A, geometry B)`\n", + "compares two geometries of the same dimension and returns TRUE if their\n", + "intersection set results in a geometry different from both but of the\n", + "same dimension.\n", + "\n", + "Let\\'s take our Broad Street subway station and determine its\n", + "neighborhood using the `ST_Intersects`\n", + "function:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6b473544", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "SELECT name, ST_AsText(geom)\n", + "FROM nyc_subway_stations\n", + "WHERE name = 'Broad St';" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "df75bf2e", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "SELECT name, boroname\n", + "FROM nyc_neighborhoods\n", + "WHERE ST_Intersects(geom, ST_GeomFromText('POINT(583571 4506714)'));" + ] + }, + { + "cell_type": "markdown", + "id": "a1e17faf", + "metadata": {}, + "source": [ + "## ST_Touches\n", + "\n", + "`ST_Touches` tests whether two\n", + "geometries touch at their boundaries, but do not intersect in their\n", + "interiors\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_touches.png)\n", + "\n", + "`ST_Touches(geometry A, geometry B)`\n", + "returns TRUE if either of the geometries\\' boundaries intersect or if\n", + "only one of the geometry\\'s interiors intersects the other\\'s boundary.\n", + "\n", + "## ST_Within and ST_Contains\n", + "\n", + "`ST_Within` and\n", + "`ST_Contains` test whether one\n", + "geometry is fully within the other.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_within.png)\n", + "\n", + "`ST_Within(geometry A , geometry B)`\n", + "returns TRUE if the first geometry is completely within the second\n", + "geometry. ST_Within tests for the exact opposite result of ST_Contains.\n", + "\n", + "`ST_Contains(geometry A, geometry B)`\n", + "returns TRUE if the second geometry is completely contained by the first\n", + "geometry.\n", + "\n", + "## ST_Distance and ST_DWithin\n", + "\n", + "An extremely common GIS question is \\\"find all the stuff within distance\n", + "X of this other stuff\\\".\n", + "\n", + "The `ST_Distance(geometry A, geometry B)` calculates the *shortest* distance between two\n", + "geometries and returns it as a float. This is useful for actually\n", + "reporting back the distance between objects." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "80a18087", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "SELECT ST_Distance(\n", + " ST_GeomFromText('POINT(0 5)'),\n", + " ST_GeomFromText('LINESTRING(-2 2, 2 2)'));" + ] + }, + { + "cell_type": "markdown", + "id": "54331019", + "metadata": {}, + "source": [ + "For testing whether two objects are within a distance of one another,\n", + "the `ST_DWithin` function provides an\n", + "index-accelerated true/false test. This is useful for questions like\n", + "\\\"how many trees are within a 500 meter buffer of the road?\\\". You\n", + "don\\'t have to calculate an actual buffer, you just have to test the\n", + "distance relationship.\n", + "\n", + "![](https://postgis.net/workshops/postgis-intro/_images/st_dwithin.png)\n", + "\n", + "Using our Broad Street subway station again, we can find the streets\n", + "nearby (within 10 meters of) the subway stop:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4e657ef0", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "\n", + "SELECT name\n", + "FROM nyc_streets\n", + "WHERE ST_DWithin(\n", + " geom,\n", + " ST_GeomFromText('POINT(583571 4506714)'),\n", + " 10\n", + " );" + ] + }, + { + "cell_type": "markdown", + "id": "0540cf98", + "metadata": {}, + "source": [ + "And we can verify the answer on a map. The Broad St station is actually\n", + "at the intersection of Wall, Broad and Nassau Streets.\n", + "\n", + "![image](https://postgis.net/workshops/postgis-intro/_images/broad_st.jpg)\n", + "\n", + "## Function List\n", + "\n", + "[ST_Contains(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Contains.html): Returns true if and only\n", + "if no points of B lie in the exterior of A, and at least one point of\n", + "the interior of B lies in the interior of A.\n", + "\n", + "[ST_Crosses(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Crosses.html): Returns TRUE if the\n", + "supplied geometries have some, but not all, interior points in common.\n", + "\n", + "[ST_Disjoint(geometry A , geometry\n", + "B)](http://postgis.net/docs/ST_Disjoint.html): Returns TRUE if the\n", + "Geometries do not \\\"spatially intersect\\\" - if they do not share any\n", + "space together.\n", + "\n", + "[ST_Distance(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Distance.html): Returns the 2-dimensional\n", + "cartesian minimum distance (based on spatial ref) between two geometries\n", + "in projected units.\n", + "\n", + "[ST_DWithin(geometry A, geometry B,\n", + "radius)](http://postgis.net/docs/ST_DWithin.html): Returns true if the\n", + "geometries are within the specified distance (radius) of one another.\n", + "\n", + "[ST_Equals(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Equals.html): Returns true if the given\n", + "geometries represent the same geometry. Directionality is ignored.\n", + "\n", + "[ST_Intersects(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Intersects.html): Returns TRUE if the\n", + "Geometries/Geography \\\"spatially intersect\\\" - (share any portion of\n", + "space) and FALSE if they don\\'t (they are Disjoint).\n", + "\n", + "[ST_Overlaps(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Overlaps.html): Returns TRUE if the\n", + "Geometries share space, are of the same dimension, but are not\n", + "completely contained by each other.\n", + "\n", + "[ST_Touches(geometry A, geometry\n", + "B)](http://postgis.net/docs/ST_Touches.html): Returns TRUE if the\n", + "geometries have at least one point in common, but their interiors do not\n", + "intersect.\n", + "\n", + "[ST_Within(geometry A , geometry\n", + "B)](http://postgis.net/docs/ST_Within.html): Returns true if the\n", + "geometry A is completely inside geometry B" + ] + } + ], + "metadata": { + "jupytext": { + "text_representation": { + "extension": ".md", + "format_name": "myst", + "format_version": 0.13, + "jupytext_version": "1.15.2" + } + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "source_map": [ + 12, + 22, + 24, + 28, + 37, + 41, + 45, + 48, + 54, + 59, + 66, + 70, + 91, + 107, + 113, + 118, + 124, + 167, + 175, + 181, + 220, + 226, + 240, + 250 + ] + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/_sources/book/duckdb/07_spatial_relationships.md b/_sources/book/duckdb/07_spatial_relationships.md new file mode 100644 index 0000000..fd429e5 --- /dev/null +++ b/_sources/book/duckdb/07_spatial_relationships.md @@ -0,0 +1,303 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst + format_version: 0.13 + jupytext_version: 1.15.2 +kernelspec: + display_name: Python 3 + language: python + name: python3 +--- + +# Spatial Relationships + +## Introduction + +## Installation + +Uncomment the following cell to install the required packages if needed. + +```{code-cell} ipython3 +# %pip install duckdb duckdb-engine jupysql +``` + +## Library Import and Configuration + +```{code-cell} ipython3 +import duckdb +import leafmap +import pandas as pd + +# Import jupysql Jupyter extension to create SQL cells +%load_ext sql +``` + +```{code-cell} ipython3 +%config SqlMagic.autopandas = True +%config SqlMagic.feedback = False +%config SqlMagic.displaycon = False +``` + +## Sample Data + +```{code-cell} ipython3 +url = "https://open.gishub.org/data/duckdb/nyc_data.db.zip" +leafmap.download_file(url, unzip=True) +``` + +## Connecting to DuckDB + +Connect jupysql to DuckDB using a SQLAlchemy-style connection string. You may either connect to an in memory DuckDB, or a file backed db. + +```{code-cell} ipython3 +# %sql duckdb:///:memory: +%sql duckdb:///nyc_data.db +``` + +```{code-cell} ipython3 +%%sql + +INSTALL spatial; +LOAD spatial; +``` + +```{code-cell} ipython3 +%%sql + +SELECT * from nyc_subway_stations LIMIT 5 +``` + +## Spatial Relationships + +So far we have only used spatial functions that measure (`ST_Area`, +`ST_Length`), serialize (`ST_GeomFromText`) or deserialize (`ST_AsGML`) +geometries. What these functions have in common is that they only work +on one geometry at a time. + +Spatial databases are powerful because they not only store geometry, +they also have the ability to compare *relationships between +geometries*. + +Questions like "Which are the closest bike racks to a park?" or "Where +are the intersections of subway lines and streets?" can only be answered +by comparing geometries representing the bike racks, streets, and subway +lines. + +The OGC standard defines the following set of methods to compare +geometries. + ++++ + +## ST_Equals + +`ST_Equals(geometry A, geometry B)`tests the spatial equality of two geometries. + +![](https://postgis.net/workshops/postgis-intro/_images/st_equals.png) + +ST_Equals returns TRUE if two geometries of the same type have identical +x,y coordinate values, i.e. if the second shape is equal (identical) to +the first shape. + +First, let\'s retrieve a representation of a point from our +`nyc_subway_stations` table. We\'ll take just the entry for \'Broad +St\'. + +```{code-cell} ipython3 +%%sql + +SELECT name, geom, ST_AsText(geom) +FROM nyc_subway_stations +WHERE name = 'Broad St'; +``` + +Then, plug the geometry representation back into an +`ST_Equals` test: + +```{code-cell} ipython3 +%%sql + +SELECT name +FROM nyc_subway_stations +WHERE ST_Equals(geom, ST_GeomFromHEXWKB('0101000020266900000EEBD4CF27CF2141BC17D69516315141')); +``` + +## ST_Intersects, ST_Disjoint, ST_Crosses and ST_Overlaps + +`ST_Intersects`, +`ST_Crosses`, and +`ST_Overlaps` test whether the +interiors of the geometries intersect. + +![](https://postgis.net/workshops/postgis-intro/_images/st_intersects.png) + +`ST_Intersects(geometry A, geometry B)` returns t (TRUE) if the two shapes have any space in +common, i.e., if their boundaries or interiors intersect. + +![](https://postgis.net/workshops/postgis-intro/_images/st_disjoint.png) + +The opposite of ST_Intersects is +`ST_Disjoint(geometry A , geometry B)`. If two geometries are disjoint, they do not intersect, +and vice-versa. In fact, it is often more efficient to test \"not +intersects\" than to test \"disjoint\" because the intersects tests can +be spatially indexed, while the disjoint test cannot. + +![](https://postgis.net/workshops/postgis-intro/_images/st_crosses.png) + +For multipoint/polygon, multipoint/linestring, linestring/linestring, +linestring/polygon, and linestring/multipolygon comparisons, +`ST_Crosses(geometry A, geometry B)` +returns t (TRUE) if the intersection results in a geometry whose +dimension is one less than the maximum dimension of the two source +geometries and the intersection set is interior to both source +geometries. + +![](https://postgis.net/workshops/postgis-intro/_images/st_overlaps.png) + +`ST_Overlaps(geometry A, geometry B)` +compares two geometries of the same dimension and returns TRUE if their +intersection set results in a geometry different from both but of the +same dimension. + +Let\'s take our Broad Street subway station and determine its +neighborhood using the `ST_Intersects` +function: + +```{code-cell} ipython3 +%%sql + +SELECT name, ST_AsText(geom) +FROM nyc_subway_stations +WHERE name = 'Broad St'; +``` + +```{code-cell} ipython3 +%%sql + +SELECT name, boroname +FROM nyc_neighborhoods +WHERE ST_Intersects(geom, ST_GeomFromText('POINT(583571 4506714)')); +``` + +## ST_Touches + +`ST_Touches` tests whether two +geometries touch at their boundaries, but do not intersect in their +interiors + +![](https://postgis.net/workshops/postgis-intro/_images/st_touches.png) + +`ST_Touches(geometry A, geometry B)` +returns TRUE if either of the geometries\' boundaries intersect or if +only one of the geometry\'s interiors intersects the other\'s boundary. + +## ST_Within and ST_Contains + +`ST_Within` and +`ST_Contains` test whether one +geometry is fully within the other. + +![](https://postgis.net/workshops/postgis-intro/_images/st_within.png) + +`ST_Within(geometry A , geometry B)` +returns TRUE if the first geometry is completely within the second +geometry. ST_Within tests for the exact opposite result of ST_Contains. + +`ST_Contains(geometry A, geometry B)` +returns TRUE if the second geometry is completely contained by the first +geometry. + +## ST_Distance and ST_DWithin + +An extremely common GIS question is \"find all the stuff within distance +X of this other stuff\". + +The `ST_Distance(geometry A, geometry B)` calculates the *shortest* distance between two +geometries and returns it as a float. This is useful for actually +reporting back the distance between objects. + +```{code-cell} ipython3 +%%sql + +SELECT ST_Distance( + ST_GeomFromText('POINT(0 5)'), + ST_GeomFromText('LINESTRING(-2 2, 2 2)')); +``` + +For testing whether two objects are within a distance of one another, +the `ST_DWithin` function provides an +index-accelerated true/false test. This is useful for questions like +\"how many trees are within a 500 meter buffer of the road?\". You +don\'t have to calculate an actual buffer, you just have to test the +distance relationship. + +![](https://postgis.net/workshops/postgis-intro/_images/st_dwithin.png) + +Using our Broad Street subway station again, we can find the streets +nearby (within 10 meters of) the subway stop: + +```{code-cell} ipython3 +%%sql + +SELECT name +FROM nyc_streets +WHERE ST_DWithin( + geom, + ST_GeomFromText('POINT(583571 4506714)'), + 10 + ); +``` + +And we can verify the answer on a map. The Broad St station is actually +at the intersection of Wall, Broad and Nassau Streets. + +![image](https://postgis.net/workshops/postgis-intro/_images/broad_st.jpg) + +## Function List + +[ST_Contains(geometry A, geometry +B)](http://postgis.net/docs/ST_Contains.html): Returns true if and only +if no points of B lie in the exterior of A, and at least one point of +the interior of B lies in the interior of A. + +[ST_Crosses(geometry A, geometry +B)](http://postgis.net/docs/ST_Crosses.html): Returns TRUE if the +supplied geometries have some, but not all, interior points in common. + +[ST_Disjoint(geometry A , geometry +B)](http://postgis.net/docs/ST_Disjoint.html): Returns TRUE if the +Geometries do not \"spatially intersect\" - if they do not share any +space together. + +[ST_Distance(geometry A, geometry +B)](http://postgis.net/docs/ST_Distance.html): Returns the 2-dimensional +cartesian minimum distance (based on spatial ref) between two geometries +in projected units. + +[ST_DWithin(geometry A, geometry B, +radius)](http://postgis.net/docs/ST_DWithin.html): Returns true if the +geometries are within the specified distance (radius) of one another. + +[ST_Equals(geometry A, geometry +B)](http://postgis.net/docs/ST_Equals.html): Returns true if the given +geometries represent the same geometry. Directionality is ignored. + +[ST_Intersects(geometry A, geometry +B)](http://postgis.net/docs/ST_Intersects.html): Returns TRUE if the +Geometries/Geography \"spatially intersect\" - (share any portion of +space) and FALSE if they don\'t (they are Disjoint). + +[ST_Overlaps(geometry A, geometry +B)](http://postgis.net/docs/ST_Overlaps.html): Returns TRUE if the +Geometries share space, are of the same dimension, but are not +completely contained by each other. + +[ST_Touches(geometry A, geometry +B)](http://postgis.net/docs/ST_Touches.html): Returns TRUE if the +geometries have at least one point in common, but their interiors do not +intersect. + +[ST_Within(geometry A , geometry +B)](http://postgis.net/docs/ST_Within.html): Returns true if the +geometry A is completely inside geometry B diff --git a/_sources/book/gee/01_introduction.ipynb b/_sources/book/gee/01_introduction.ipynb index c37b988..208fac0 100644 --- a/_sources/book/gee/01_introduction.ipynb +++ b/_sources/book/gee/01_introduction.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b32d04eb", + "id": "baea34d0", "metadata": {}, "source": [ "(chapter01)=\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "f0947946", + "id": "07298b99", "metadata": {}, "source": [ "## Introduction\n", @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f90857a", + "id": "cb02c331", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "c423e387", + "id": "d9474e13", "metadata": {}, "source": [ "### Using Docker\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af589075", + "id": "bd8db31d", "metadata": {}, "outputs": [], "source": [ @@ -294,7 +294,7 @@ }, { "cell_type": "markdown", - "id": "8603ea71", + "id": "136b6f1f", "metadata": {}, "source": [ "After running the above script, a new tab will open in the browser asking you to sign in to your Earth Engine account. After signing in, you will be asked to authorize the Google Earth Engine Authenticator. If this is the first time you are authenticating Earth Engine, click **CHOOSE PROJECT** to select a Cloud Project to use for Earth Engine (see {numref}`ch01_generate_token`).\n", @@ -348,7 +348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "114d99a1", + "id": "e468354d", "metadata": {}, "outputs": [], "source": [ @@ -359,7 +359,7 @@ }, { "cell_type": "markdown", - "id": "a628e4b7", + "id": "5f39debe", "metadata": {}, "source": [ "Once Earth Engine is authenticated, you can run the following script to initialize Earth Engine for a new Python session." @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6ae7f6f", + "id": "d6295e74", "metadata": {}, "outputs": [], "source": [ @@ -377,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "bf7e7c30", + "id": "00e7f35b", "metadata": {}, "source": [ "In general, you will need to initialize Earth Engine for each new Python session, i.e., whenever you open a Jupyter notebook or Python script and want to use Earth Engine. Fortunately, geemap can automatically initialize Earth Engine for you when creating an interactive map, which will be covered in the next chapter. In other words, you rarely need to run `ee.Initialize()` explicitly.\n", @@ -394,7 +394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b114117c", + "id": "40b654c4", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ }, { "cell_type": "markdown", - "id": "6e7c3e0c", + "id": "0e2da9c4", "metadata": {}, "source": [ "After geemap has been installed successfully, type the following code in a new cell:" @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "faa755c5", + "id": "6e3b3ed7", "metadata": {}, "outputs": [], "source": [ @@ -424,7 +424,7 @@ }, { "cell_type": "markdown", - "id": "7760ee51", + "id": "85e3bec0", "metadata": {}, "source": [ "Follow the on-screen instructions to authenticate Earth Engine. After that, you should be able to see the interactive map displayed beneath the code cell (see {numref}`ch01_colab`).\n", @@ -446,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "056f7c87", + "id": "53188b69", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "530cdf69", + "id": "a5c84147", "metadata": {}, "source": [ "```{figure} images/ch01_vpn_proxy.jpg\n", diff --git a/_sources/book/gee/02_maps.ipynb b/_sources/book/gee/02_maps.ipynb index e683188..33899fc 100644 --- a/_sources/book/gee/02_maps.ipynb +++ b/_sources/book/gee/02_maps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bd926284", + "id": "57f8d60e", "metadata": {}, "source": [ "# Creating Interactive Maps\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c133f9c", + "id": "ef27ea2d", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "768abebb", + "id": "c1d3b35a", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "984cefdd", + "id": "e861307f", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "cd998e4f", + "id": "3429fd5a", "metadata": {}, "source": [ "## Plotting backends\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e6adeab", + "id": "183142a4", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac8c84e8", + "id": "0f7faf6a", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7d39b3a", + "id": "985236e5", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e03afc3d", + "id": "99fc7ff0", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96f3f547", + "id": "c640ea33", "metadata": {}, "outputs": [], "source": [ @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15105d39", + "id": "ad8a9785", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "042269f2", + "id": "a65548d0", "metadata": {}, "outputs": [], "source": [ @@ -144,7 +144,7 @@ }, { "cell_type": "markdown", - "id": "056a0553", + "id": "fbdc08a4", "metadata": {}, "source": [ "### Folium" @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58c662d9", + "id": "0360d046", "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36b06bd2", + "id": "2afc485a", "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c468df8", + "id": "fddde2df", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ }, { "cell_type": "markdown", - "id": "b4b9c66e", + "id": "adb9b3a3", "metadata": {}, "source": [ "### Plotly" @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf3c27ef", + "id": "228eced2", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84e94f96", + "id": "e30149b5", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "efb6152c", + "id": "b1fabe7c", "metadata": {}, "outputs": [], "source": [ @@ -222,7 +222,7 @@ }, { "cell_type": "markdown", - "id": "b8898112", + "id": "622cfa54", "metadata": {}, "source": [ "### Pydeck" @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "225cf619", + "id": "b073f272", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd4ccde1", + "id": "f176ad62", "metadata": {}, "outputs": [], "source": [ @@ -251,7 +251,7 @@ }, { "cell_type": "markdown", - "id": "bcb6ed3d", + "id": "d7b45ea4", "metadata": {}, "source": [ "### KeplerGL" @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d25e87b5", + "id": "ce7a79c2", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6fd128a", + "id": "77c0e1c9", "metadata": {}, "outputs": [], "source": [ @@ -280,7 +280,7 @@ }, { "cell_type": "markdown", - "id": "4f69752c", + "id": "e9ff3759", "metadata": {}, "source": [ "## Adding basemaps\n", @@ -291,7 +291,7 @@ { "cell_type": "code", "execution_count": null, - "id": "589f598e", + "id": "7563a227", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53f6b933", + "id": "426c3e78", "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9202550", + "id": "235520e4", "metadata": {}, "outputs": [], "source": [ @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a709e482", + "id": "23fde928", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d8b32e3", + "id": "3b4a6c0e", "metadata": {}, "outputs": [], "source": [ @@ -342,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "8901f1d7", + "id": "a1c6033c", "metadata": {}, "source": [ "### XYZ tiles" @@ -351,7 +351,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c11bb01c", + "id": "f1cf6966", "metadata": {}, "outputs": [], "source": [ @@ -366,7 +366,7 @@ }, { "cell_type": "markdown", - "id": "2ad3622a", + "id": "896d15ac", "metadata": {}, "source": [ "### WMS tiles" @@ -375,7 +375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b330a3dd", + "id": "e8e7d252", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ }, { "cell_type": "markdown", - "id": "20348fe1", + "id": "48b9514d", "metadata": {}, "source": [ "### Planet basemaps" @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44a10668", + "id": "243efc18", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7eb8eeb", + "id": "ad3ba920", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +427,7 @@ { "cell_type": "code", "execution_count": null, - "id": "68cf00fc", + "id": "7cebe27a", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30e3b33b", + "id": "b23fe5cb", "metadata": {}, "outputs": [], "source": [ @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89607817", + "id": "b6fb132b", "metadata": {}, "outputs": [], "source": [ @@ -462,7 +462,7 @@ }, { "cell_type": "markdown", - "id": "c9cf687a", + "id": "36329148", "metadata": {}, "source": [ "### Basemap GUI" @@ -471,7 +471,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aa612aec", + "id": "666a59a8", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdad2692", + "id": "b1878ed3", "metadata": {}, "outputs": [], "source": [ @@ -493,7 +493,7 @@ }, { "cell_type": "markdown", - "id": "eb21f65b", + "id": "c6e8f134", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/03_gee_data.ipynb b/_sources/book/gee/03_gee_data.ipynb index e94ad49..4dd90e6 100644 --- a/_sources/book/gee/03_gee_data.ipynb +++ b/_sources/book/gee/03_gee_data.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "58cf574b", + "id": "ee8e361f", "metadata": {}, "source": [ "# Using Earth Engine Data\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d1e1c7e", + "id": "23c76576", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "646b2b62", + "id": "afc814a6", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4aa329cb", + "id": "8fce62af", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "3ba7324c", + "id": "8e1670ac", "metadata": {}, "source": [ "## Earth Engine data types\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "483c5926", + "id": "19d93e4e", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bcc21fe", + "id": "2f09c23a", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ae984f8", + "id": "f8d08884", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "c580ce65", + "id": "bb8a3db0", "metadata": {}, "source": [ "#### Visualizing Earth Engine images" @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6005edf3", + "id": "7f38c3d1", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "178b2b48", + "id": "7d003427", "metadata": {}, "source": [ "#### Loading Cloud GeoTIFFs" @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c2c0c4b", + "id": "8ff9e000", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2531b3f", + "id": "05478601", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d35ad2c", + "id": "e43a249d", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d8710fe", + "id": "9f459e93", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "9a533be4", + "id": "8d39801b", "metadata": {}, "source": [ "### ImageCollection\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eceddf3d", + "id": "6a7609a1", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85196a18", + "id": "8118196a", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ }, { "cell_type": "markdown", - "id": "6209636c", + "id": "e717f21e", "metadata": {}, "source": [ "#### Visualizing image collections" @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98f13df0", + "id": "5d538cbe", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "150059ef", + "id": "0bcb1670", "metadata": {}, "source": [ "#### Filtering image collections" @@ -264,7 +264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df37d738", + "id": "34b01245", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "15a0a939", + "id": "c0bc5baf", "metadata": {}, "source": [ "### Geometry\n", @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "002f84ec", + "id": "efee5b46", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d30444d3", + "id": "6710e97b", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ }, { "cell_type": "markdown", - "id": "825feb5c", + "id": "951bac7d", "metadata": {}, "source": [ "#### Using drawing tools" @@ -372,7 +372,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf581d3a", + "id": "3dc26eea", "metadata": {}, "outputs": [], "source": [ @@ -383,7 +383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1880828f", + "id": "26144229", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "fa253a26", + "id": "82a7e5be", "metadata": {}, "source": [ "### Feature\n", @@ -404,7 +404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e02597a", + "id": "4a35e8b0", "metadata": {}, "outputs": [], "source": [ @@ -417,7 +417,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a352ac4", + "id": "5d2210e0", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +427,7 @@ { "cell_type": "code", "execution_count": null, - "id": "540a9ba0", + "id": "6238ad54", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6dff9f0e", + "id": "117bb824", "metadata": {}, "outputs": [], "source": [ @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "047ac327", + "id": "11e24e50", "metadata": {}, "source": [ "#### Setting Feature properties" @@ -459,7 +459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "977fb058", + "id": "43e755ac", "metadata": {}, "outputs": [], "source": [ @@ -475,7 +475,7 @@ }, { "cell_type": "markdown", - "id": "67ae3739", + "id": "b99c63bd", "metadata": {}, "source": [ "#### Getting Feature properties" @@ -484,7 +484,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3182100d", + "id": "cc857a78", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25d7e6b9", + "id": "af851e98", "metadata": {}, "outputs": [], "source": [ @@ -505,7 +505,7 @@ }, { "cell_type": "markdown", - "id": "fd17a732", + "id": "5e1ac5a9", "metadata": {}, "source": [ "### FeatureCollection\n", @@ -516,7 +516,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f5c8042", + "id": "d8b26285", "metadata": {}, "outputs": [], "source": [ @@ -530,7 +530,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52a91f25", + "id": "2861734f", "metadata": {}, "outputs": [], "source": [ @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "0b953da0", + "id": "5d47528e", "metadata": {}, "source": [ "#### Creating feature collections" @@ -548,7 +548,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d209d83", + "id": "018d8104", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "42e77e2a", + "id": "31d5087f", "metadata": {}, "source": [ "#### Filtering feature collections" @@ -571,7 +571,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38a6223d", + "id": "613d30ec", "metadata": {}, "outputs": [], "source": [ @@ -586,7 +586,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b217f116", + "id": "bef5a50b", "metadata": {}, "outputs": [], "source": [ @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "040ae586", + "id": "2660795d", "metadata": {}, "outputs": [], "source": [ @@ -612,7 +612,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e52240a7", + "id": "0765104b", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "4a3b7288", + "id": "9737af7d", "metadata": {}, "source": [ "#### Visualizing feature collections" @@ -636,7 +636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47737dc9", + "id": "a742ab34", "metadata": {}, "outputs": [], "source": [ @@ -649,7 +649,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5b5e9f4", + "id": "929e1af8", "metadata": {}, "outputs": [], "source": [ @@ -663,7 +663,7 @@ { "cell_type": "code", "execution_count": null, - "id": "574d10aa", + "id": "87d08d6f", "metadata": {}, "outputs": [], "source": [ @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "790763ba", + "id": "70b558fe", "metadata": {}, "outputs": [], "source": [ @@ -701,7 +701,7 @@ }, { "cell_type": "markdown", - "id": "b0cfa1cc", + "id": "8e6a0639", "metadata": {}, "source": [ "#### Styling by attribute" @@ -710,7 +710,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a78c752", + "id": "8d7c1fff", "metadata": {}, "outputs": [], "source": [ @@ -721,7 +721,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c267c6e1", + "id": "1f5cd0c5", "metadata": {}, "outputs": [], "source": [ @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10cacbb0", + "id": "c549ab39", "metadata": {}, "outputs": [], "source": [ @@ -766,7 +766,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d5653d6", + "id": "c94200de", "metadata": {}, "outputs": [], "source": [ @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d571267", + "id": "0b7a4dcc", "metadata": {}, "outputs": [], "source": [ @@ -811,7 +811,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9f60ddd", + "id": "f1301f0a", "metadata": {}, "outputs": [], "source": [ @@ -824,7 +824,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0011906d", + "id": "821d5344", "metadata": {}, "outputs": [], "source": [ @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79e89813", + "id": "6dfb40f7", "metadata": {}, "outputs": [], "source": [ @@ -850,7 +850,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aec186b7", + "id": "35b9ed38", "metadata": {}, "outputs": [], "source": [ @@ -863,7 +863,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31f45296", + "id": "85a84bb3", "metadata": {}, "outputs": [], "source": [ @@ -875,7 +875,7 @@ }, { "cell_type": "markdown", - "id": "db82af74", + "id": "db8f862a", "metadata": {}, "source": [ "## Earth Engine Data Catalog\n", @@ -886,7 +886,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4dbfe64", + "id": "21143c30", "metadata": {}, "outputs": [], "source": [ @@ -897,7 +897,7 @@ { "cell_type": "code", "execution_count": null, - "id": "348af282", + "id": "d427d00c", "metadata": {}, "outputs": [], "source": [ @@ -914,7 +914,7 @@ }, { "cell_type": "markdown", - "id": "7a94298b", + "id": "6b6643a2", "metadata": {}, "source": [ "### Using the datasets module" @@ -923,7 +923,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49bbbbaa", + "id": "ddb0ac45", "metadata": {}, "outputs": [], "source": [ @@ -933,7 +933,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a192adc8", + "id": "80986182", "metadata": {}, "outputs": [], "source": [ @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c66b4626", + "id": "d862d19e", "metadata": {}, "outputs": [], "source": [ @@ -957,7 +957,7 @@ }, { "cell_type": "markdown", - "id": "c8664ff6", + "id": "8b08a0b0", "metadata": {}, "source": [ "## Getting image metadata" @@ -966,7 +966,7 @@ { "cell_type": "code", "execution_count": null, - "id": "160a3879", + "id": "25c640da", "metadata": {}, "outputs": [], "source": [ @@ -976,7 +976,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12ec5b3f", + "id": "23704878", "metadata": {}, "outputs": [], "source": [ @@ -986,7 +986,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ec3f8ef", + "id": "4f7ffebd", "metadata": {}, "outputs": [], "source": [ @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5811c760", + "id": "5c931ee1", "metadata": {}, "outputs": [], "source": [ @@ -1006,7 +1006,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bd166ec", + "id": "dac78089", "metadata": {}, "outputs": [], "source": [ @@ -1016,7 +1016,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ae3189b", + "id": "06d12628", "metadata": {}, "outputs": [], "source": [ @@ -1026,7 +1026,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be3b7d29", + "id": "2d24e00d", "metadata": {}, "outputs": [], "source": [ @@ -1036,7 +1036,7 @@ { "cell_type": "code", "execution_count": null, - "id": "663b0d22", + "id": "38decbde", "metadata": {}, "outputs": [], "source": [ @@ -1046,7 +1046,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2fa389e", + "id": "746fce31", "metadata": {}, "outputs": [], "source": [ @@ -1057,7 +1057,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ebd59e9", + "id": "fa459cee", "metadata": {}, "outputs": [], "source": [ @@ -1067,7 +1067,7 @@ { "cell_type": "code", "execution_count": null, - "id": "917720ce", + "id": "6ff1d25a", "metadata": {}, "outputs": [], "source": [ @@ -1077,7 +1077,7 @@ }, { "cell_type": "markdown", - "id": "25f0b707", + "id": "b1611343", "metadata": {}, "source": [ "## Calculating descriptive statistics" @@ -1086,7 +1086,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5d958a0", + "id": "e10dfb2c", "metadata": {}, "outputs": [], "source": [ @@ -1097,7 +1097,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5ebf764", + "id": "ab012abb", "metadata": {}, "outputs": [], "source": [ @@ -1107,7 +1107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29351d5e", + "id": "b12c91c7", "metadata": {}, "outputs": [], "source": [ @@ -1117,7 +1117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3322e41a", + "id": "936dd9e5", "metadata": {}, "outputs": [], "source": [ @@ -1126,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "5c6964c2", + "id": "6d664c86", "metadata": {}, "source": [ "## Using the inspector tool" @@ -1135,7 +1135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4172ddbb", + "id": "56a651ac", "metadata": {}, "outputs": [], "source": [ @@ -1162,7 +1162,7 @@ }, { "cell_type": "markdown", - "id": "cd93a6d8", + "id": "083d077b", "metadata": {}, "source": [ "## Converting JavaScript to Python\n", @@ -1173,7 +1173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6978c75", + "id": "a1e1c9bc", "metadata": {}, "outputs": [], "source": [ @@ -1184,7 +1184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a31cd94b", + "id": "14cbb2ab", "metadata": {}, "outputs": [], "source": [ @@ -1202,7 +1202,7 @@ }, { "cell_type": "markdown", - "id": "c6e4a52a", + "id": "21bc35ea", "metadata": {}, "source": [ "### Batch conversion" @@ -1211,7 +1211,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f053bcf", + "id": "07d44f6d", "metadata": {}, "outputs": [], "source": [ @@ -1232,7 +1232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7f51e3d", + "id": "f8a5f10c", "metadata": {}, "outputs": [], "source": [ @@ -1250,7 +1250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42f167bf", + "id": "e7f86a41", "metadata": {}, "outputs": [], "source": [ @@ -1265,7 +1265,7 @@ }, { "cell_type": "markdown", - "id": "26a7ecb0", + "id": "2fe13d62", "metadata": {}, "source": [ "## Calling JavaScript functions from Python" @@ -1274,7 +1274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e89862ea", + "id": "8e805934", "metadata": {}, "outputs": [], "source": [ @@ -1284,7 +1284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42414579", + "id": "8d8a1b3a", "metadata": {}, "outputs": [], "source": [ @@ -1294,7 +1294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82e8e287", + "id": "897be10b", "metadata": {}, "outputs": [], "source": [ @@ -1304,7 +1304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a3d4ed1", + "id": "8ab85704", "metadata": {}, "outputs": [], "source": [ @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "beafe8b4", + "id": "ea98dba8", "metadata": {}, "outputs": [], "source": [ @@ -1331,7 +1331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21dc4019", + "id": "bd6a38dd", "metadata": {}, "outputs": [], "source": [ @@ -1341,7 +1341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae6277c3", + "id": "9564840d", "metadata": {}, "outputs": [], "source": [ @@ -1352,7 +1352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb28220a", + "id": "b763852c", "metadata": {}, "outputs": [], "source": [ @@ -1365,7 +1365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a437408", + "id": "2c01de7b", "metadata": {}, "outputs": [], "source": [ @@ -1376,7 +1376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4958f934", + "id": "e309efee", "metadata": {}, "outputs": [], "source": [ @@ -1387,7 +1387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a05fcbd", + "id": "3758bdce", "metadata": {}, "outputs": [], "source": [ @@ -1398,7 +1398,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e39521f9", + "id": "e9254249", "metadata": {}, "outputs": [], "source": [ @@ -1408,7 +1408,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a508314", + "id": "369bc78b", "metadata": {}, "outputs": [], "source": [ @@ -1418,7 +1418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18f4e164", + "id": "f1d4920f", "metadata": {}, "outputs": [], "source": [ @@ -1430,7 +1430,7 @@ }, { "cell_type": "markdown", - "id": "7c3de9f9", + "id": "e3fca203", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/04_local_data.ipynb b/_sources/book/gee/04_local_data.ipynb index ef1de37..f3f4c3e 100644 --- a/_sources/book/gee/04_local_data.ipynb +++ b/_sources/book/gee/04_local_data.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bfb7c7bf", + "id": "1361a6a3", "metadata": {}, "source": [ "# Using Local Geospatial Data\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c89c4f8", + "id": "3cb76423", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "372bb49e", + "id": "bb1c6639", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a536e35", + "id": "519dc9af", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "e2c6be02", + "id": "b8cfb408", "metadata": {}, "source": [ "## Local raster datasets\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bcc5e0b", + "id": "abefaa0d", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15e5ac33", + "id": "9d416618", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72e72a29", + "id": "0c007c9e", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a208c1b5", + "id": "be35ac76", "metadata": {}, "outputs": [], "source": [ @@ -118,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "e8beea41", + "id": "f3ad16c2", "metadata": {}, "source": [ "### Multi-band imagery" @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a27b93aa", + "id": "3c753d8b", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63300c37", + "id": "539c788d", "metadata": {}, "outputs": [], "source": [ @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "d4cef2f2", + "id": "3117e9d9", "metadata": {}, "source": [ "### Interactive raster GUI\n", @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7403f6e8", + "id": "99e53367", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b288c91d", + "id": "05c0f40b", "metadata": {}, "outputs": [], "source": [ @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e356142", + "id": "37534c05", "metadata": {}, "outputs": [], "source": [ @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fa6aeff", + "id": "411263ca", "metadata": {}, "outputs": [], "source": [ @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61db8cf6", + "id": "dc50bdd2", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4215f90a", + "id": "149def27", "metadata": {}, "outputs": [], "source": [ @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f66ee80a", + "id": "ed2b6e61", "metadata": {}, "outputs": [], "source": [ @@ -236,7 +236,7 @@ }, { "cell_type": "markdown", - "id": "9b37d2ed", + "id": "df32f535", "metadata": {}, "source": [ "### Creating COG" @@ -245,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfb62ac3", + "id": "3e15b466", "metadata": {}, "outputs": [], "source": [ @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a82b4ff7", + "id": "26bed9c0", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f550fa5f", + "id": "2d880bfa", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b7b8c6b", + "id": "e836b682", "metadata": {}, "outputs": [], "source": [ @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5807fecc", + "id": "dc9d6eaa", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "83bfc33d", + "id": "fc77636c", "metadata": {}, "source": [ "### Converting NumPy arrays to COG" @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0926ebe4", + "id": "dff99841", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1edd4c9", + "id": "06d95dca", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ { "cell_type": "code", "execution_count": null, - "id": "304c1c7f", + "id": "24d45dd0", "metadata": {}, "outputs": [], "source": [ @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bed2be4c", + "id": "28e084b9", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d01e74b6", + "id": "10282094", "metadata": {}, "outputs": [], "source": [ @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7ebb994", + "id": "243597bb", "metadata": {}, "outputs": [], "source": [ @@ -373,7 +373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afdd2128", + "id": "370a5b11", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "990f3b09", + "id": "a4f20724", "metadata": {}, "source": [ "### Clipping image by mask" @@ -394,7 +394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d0565d1", + "id": "9c885495", "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60c8b078", + "id": "5493c7c9", "metadata": {}, "outputs": [], "source": [ @@ -418,7 +418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73141834", + "id": "61f80c5f", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd43bfb1", + "id": "f30815e4", "metadata": {}, "outputs": [], "source": [ @@ -440,7 +440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "114f98ef", + "id": "0f300021", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64c891bc", + "id": "cdc8df63", "metadata": {}, "outputs": [], "source": [ @@ -468,7 +468,7 @@ }, { "cell_type": "markdown", - "id": "f3dc2f1d", + "id": "4fcb043a", "metadata": {}, "source": [ "## SpatioTemporal Asset Catalog (STAC)" @@ -477,7 +477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e65e7d76", + "id": "14554c0b", "metadata": {}, "outputs": [], "source": [ @@ -487,7 +487,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4f5f8ac", + "id": "9871b20c", "metadata": {}, "outputs": [], "source": [ @@ -497,7 +497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3318a6a", + "id": "bf099d2b", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +507,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3395907", + "id": "463d2d4a", "metadata": {}, "outputs": [], "source": [ @@ -517,7 +517,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b97e083", + "id": "3809f8f9", "metadata": {}, "outputs": [], "source": [ @@ -527,7 +527,7 @@ { "cell_type": "code", "execution_count": null, - "id": "caa1b21f", + "id": "90ac4f29", "metadata": {}, "outputs": [], "source": [ @@ -539,7 +539,7 @@ }, { "cell_type": "markdown", - "id": "3a367a6a", + "id": "bb24c949", "metadata": {}, "source": [ "## Vector datasets\n", @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4fcc2d9", + "id": "7d5abda7", "metadata": {}, "outputs": [], "source": [ @@ -565,7 +565,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95780616", + "id": "76fe3e7d", "metadata": {}, "outputs": [], "source": [ @@ -579,7 +579,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac217d21", + "id": "f16ed3bb", "metadata": {}, "outputs": [], "source": [ @@ -594,7 +594,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f715ad2", + "id": "c8b15a4c", "metadata": {}, "outputs": [], "source": [ @@ -616,7 +616,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8753a5e4", + "id": "48cecad4", "metadata": {}, "outputs": [], "source": [ @@ -640,7 +640,7 @@ }, { "cell_type": "markdown", - "id": "11845c8f", + "id": "5d946f43", "metadata": {}, "source": [ "### Shapefile" @@ -649,7 +649,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abbfb8ac", + "id": "80f09b42", "metadata": {}, "outputs": [], "source": [ @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84423571", + "id": "b6e82e53", "metadata": {}, "outputs": [], "source": [ @@ -672,7 +672,7 @@ }, { "cell_type": "markdown", - "id": "72971d93", + "id": "c288e889", "metadata": {}, "source": [ "### KML" @@ -681,7 +681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e9fb4f3", + "id": "f887e6fe", "metadata": {}, "outputs": [], "source": [ @@ -691,7 +691,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7137ee9", + "id": "d144942b", "metadata": {}, "outputs": [], "source": [ @@ -702,7 +702,7 @@ }, { "cell_type": "markdown", - "id": "2c6c562a", + "id": "b224ee10", "metadata": {}, "source": [ "### GeoDataFrame" @@ -711,7 +711,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4fab19c", + "id": "1eab430f", "metadata": {}, "outputs": [], "source": [ @@ -721,7 +721,7 @@ { "cell_type": "code", "execution_count": null, - "id": "284c89af", + "id": "fdf0d6f0", "metadata": {}, "outputs": [], "source": [ @@ -733,7 +733,7 @@ }, { "cell_type": "markdown", - "id": "ef4c3ea8", + "id": "5f41753a", "metadata": {}, "source": [ "### Other vector formats" @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c3ec4fb", + "id": "3a2daf4c", "metadata": {}, "outputs": [], "source": [ @@ -754,7 +754,7 @@ }, { "cell_type": "markdown", - "id": "c72ad206", + "id": "b746aa69", "metadata": {}, "source": [ "## Creating points from XY\n", @@ -765,7 +765,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cdd5e2ff", + "id": "1850c34c", "metadata": {}, "outputs": [], "source": [ @@ -776,7 +776,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53618b50", + "id": "a326b07d", "metadata": {}, "outputs": [], "source": [ @@ -788,7 +788,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff149322", + "id": "70590bc4", "metadata": {}, "outputs": [], "source": [ @@ -798,7 +798,7 @@ { "cell_type": "code", "execution_count": null, - "id": "609c94b6", + "id": "ecff25c7", "metadata": {}, "outputs": [], "source": [ @@ -808,7 +808,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4c5cefd", + "id": "3bfc0b9d", "metadata": {}, "outputs": [], "source": [ @@ -817,7 +817,7 @@ }, { "cell_type": "markdown", - "id": "418e900e", + "id": "700017fe", "metadata": {}, "source": [ "### Adding points from XY" @@ -826,7 +826,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81d24df3", + "id": "7de7c192", "metadata": {}, "outputs": [], "source": [ @@ -839,7 +839,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc7d5241", + "id": "cd55c088", "metadata": {}, "outputs": [], "source": [ @@ -851,7 +851,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91de64c6", + "id": "46ae48cc", "metadata": {}, "outputs": [], "source": [ @@ -874,7 +874,7 @@ }, { "cell_type": "markdown", - "id": "69cb034e", + "id": "7abb6b2b", "metadata": {}, "source": [ "### Circle markers from points" @@ -883,7 +883,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7291b433", + "id": "ccc7f5fb", "metadata": {}, "outputs": [], "source": [ @@ -893,7 +893,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9047d85f", + "id": "e968be3c", "metadata": {}, "outputs": [], "source": [ @@ -912,7 +912,7 @@ }, { "cell_type": "markdown", - "id": "2ba5e134", + "id": "498dc5cc", "metadata": {}, "source": [ "## Vector data to Earth Engine" @@ -921,7 +921,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48eeb5e2", + "id": "570bc270", "metadata": {}, "outputs": [], "source": [ @@ -937,7 +937,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80ec70a1", + "id": "8f110813", "metadata": {}, "outputs": [], "source": [ @@ -948,7 +948,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6c171a2", + "id": "fc87e0f8", "metadata": {}, "outputs": [], "source": [ @@ -959,7 +959,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12bcf60d", + "id": "fe029869", "metadata": {}, "outputs": [], "source": [ @@ -972,7 +972,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4704fa4", + "id": "a814cb00", "metadata": {}, "outputs": [], "source": [ @@ -981,7 +981,7 @@ }, { "cell_type": "markdown", - "id": "6e561ba8", + "id": "b6fa6235", "metadata": {}, "source": [ "## Joining attribute tables" @@ -990,7 +990,7 @@ { "cell_type": "code", "execution_count": null, - "id": "055fbf64", + "id": "b9da0820", "metadata": {}, "outputs": [], "source": [ @@ -1003,7 +1003,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fcd925e", + "id": "90dd3e8b", "metadata": {}, "outputs": [], "source": [ @@ -1013,7 +1013,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dff76cc", + "id": "da16f6df", "metadata": {}, "outputs": [], "source": [ @@ -1027,7 +1027,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16233f9c", + "id": "f743e2d7", "metadata": {}, "outputs": [], "source": [ @@ -1037,7 +1037,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11aec529", + "id": "55d1d360", "metadata": {}, "outputs": [], "source": [ @@ -1047,7 +1047,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbf6d39d", + "id": "c2343f6a", "metadata": {}, "outputs": [], "source": [ @@ -1057,7 +1057,7 @@ }, { "cell_type": "markdown", - "id": "3c4b8912", + "id": "dc4e6cb6", "metadata": {}, "source": [ "## Converting NetCDF to ee.Image" @@ -1066,7 +1066,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2c698fb", + "id": "0bb253e4", "metadata": {}, "outputs": [], "source": [ @@ -1080,7 +1080,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd915be3", + "id": "761c47bf", "metadata": {}, "outputs": [], "source": [ @@ -1094,7 +1094,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c899d0d", + "id": "d6b5897a", "metadata": {}, "outputs": [], "source": [ @@ -1110,7 +1110,7 @@ }, { "cell_type": "markdown", - "id": "9e446339", + "id": "81237dbc", "metadata": {}, "source": [ "## OpenStreetMap data\n", @@ -1121,7 +1121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1eac7066", + "id": "8a5a2894", "metadata": {}, "outputs": [], "source": [ @@ -1131,7 +1131,7 @@ }, { "cell_type": "markdown", - "id": "f578df5a", + "id": "3a7ff650", "metadata": {}, "source": [ "### OSM to ee.FeatureCollection" @@ -1140,7 +1140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15bcbdab", + "id": "bbba635b", "metadata": {}, "outputs": [], "source": [ @@ -1153,7 +1153,7 @@ }, { "cell_type": "markdown", - "id": "be16a08b", + "id": "e00af1e7", "metadata": {}, "source": [ "### Downloading OSM data" @@ -1162,7 +1162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e7221d9", + "id": "a9b46c34", "metadata": {}, "outputs": [], "source": [ @@ -1172,7 +1172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b78c135d", + "id": "8aed2b37", "metadata": {}, "outputs": [], "source": [ @@ -1185,7 +1185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d7c0f7c", + "id": "c988c019", "metadata": {}, "outputs": [], "source": [ @@ -1199,7 +1199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a50ad36b", + "id": "9125c93d", "metadata": {}, "outputs": [], "source": [ @@ -1211,7 +1211,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6c4721f8", + "id": "0888d4be", "metadata": {}, "outputs": [], "source": [ @@ -1224,7 +1224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "953a4046", + "id": "de45be80", "metadata": {}, "outputs": [], "source": [ @@ -1236,7 +1236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89defbb3", + "id": "3683f316", "metadata": {}, "outputs": [], "source": [ @@ -1251,7 +1251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07b597b7", + "id": "78732fb1", "metadata": {}, "outputs": [], "source": [ @@ -1263,7 +1263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e309683", + "id": "dd78add5", "metadata": {}, "outputs": [], "source": [ @@ -1274,7 +1274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7cf9d4e", + "id": "64d71471", "metadata": {}, "outputs": [], "source": [ @@ -1283,7 +1283,7 @@ }, { "cell_type": "markdown", - "id": "f0abec2c", + "id": "9769ac8e", "metadata": {}, "source": [ "## Reading PostGIS data\n", @@ -1296,7 +1296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29f499f7", + "id": "edda09a3", "metadata": {}, "outputs": [], "source": [ @@ -1308,7 +1308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3abe219", + "id": "c792bfff", "metadata": {}, "outputs": [], "source": [ @@ -1320,7 +1320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13a2071a", + "id": "9f182348", "metadata": {}, "outputs": [], "source": [ @@ -1334,7 +1334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc6c6cd5", + "id": "beb0f127", "metadata": {}, "outputs": [], "source": [ @@ -1347,7 +1347,7 @@ }, { "cell_type": "markdown", - "id": "e864a9fb", + "id": "888f9c9c", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/05_data_viz.ipynb b/_sources/book/gee/05_data_viz.ipynb index 1572c09..4f3ee25 100644 --- a/_sources/book/gee/05_data_viz.ipynb +++ b/_sources/book/gee/05_data_viz.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b3c92c9f", + "id": "c1515fca", "metadata": {}, "source": [ "# Visualizing Geospatial Data\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "e79dae72", + "id": "308fb74b", "metadata": {}, "source": [ "## Technical requirements\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4756e22b", + "id": "6cf98f4a", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94e27132", + "id": "a9278475", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c77ea470", + "id": "e3203da6", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "32881593", + "id": "dfa67b39", "metadata": {}, "source": [ "## Using the plotting tool" @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b26d51c", + "id": "6fc2d297", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "894c0f73", + "id": "9fd8fc32", "metadata": {}, "outputs": [], "source": [ @@ -114,7 +114,7 @@ }, { "cell_type": "markdown", - "id": "89e7756c", + "id": "121f064e", "metadata": {}, "source": [ "## Changing layer opacity" @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45449999", + "id": "c22b05db", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "e9943e60", + "id": "d60f090a", "metadata": {}, "source": [ "## Visualizing raster data\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "208e2929", + "id": "71fdd219", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04d4b8ce", + "id": "2a47446a", "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "markdown", - "id": "8bf354b8", + "id": "105037e9", "metadata": {}, "source": [ "### Multi-band images" @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b5e0343", + "id": "3077f302", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ }, { "cell_type": "markdown", - "id": "7bb75b80", + "id": "6bd19ed9", "metadata": {}, "source": [ "## Visualizing vector data" @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13381bd5", + "id": "c2b8ffa9", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cc12f75", + "id": "1506b8b0", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf4b7a1c", + "id": "fa9cfdd3", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "markdown", - "id": "434c7691", + "id": "7a7e1a02", "metadata": {}, "source": [ "## Creating legends\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd217192", + "id": "ebaa7736", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +291,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4c2c86f", + "id": "e1c910de", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a7577de", + "id": "d5a152dc", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +320,7 @@ }, { "cell_type": "markdown", - "id": "341e50c1", + "id": "284a7e34", "metadata": {}, "source": [ "### Custom legends" @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "783fb1a2", + "id": "9e25fc03", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1644ccac", + "id": "d35657d3", "metadata": {}, "outputs": [], "source": [ @@ -389,7 +389,7 @@ }, { "cell_type": "markdown", - "id": "d47f1bba", + "id": "ffaa0b7d", "metadata": {}, "source": [ "### Earth Engine class table" @@ -398,7 +398,7 @@ { "cell_type": "code", "execution_count": null, - "id": "781937f0", + "id": "d03b0b47", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "c2fd3741", + "id": "68abf190", "metadata": {}, "source": [ "## Creating color bars" @@ -438,7 +438,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79748ce0", + "id": "1efaa08d", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ddf0bb80", + "id": "04ba4e35", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +467,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46ab7085", + "id": "3c0457ae", "metadata": {}, "outputs": [], "source": [ @@ -479,7 +479,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bbd5f71", + "id": "8c8843b1", "metadata": {}, "outputs": [], "source": [ @@ -494,7 +494,7 @@ }, { "cell_type": "markdown", - "id": "08cab67f", + "id": "f250dea1", "metadata": {}, "source": [ "## Displaying labels" @@ -503,7 +503,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b4946ff", + "id": "45cbff65", "metadata": {}, "outputs": [], "source": [ @@ -517,7 +517,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61780961", + "id": "b3ad5d75", "metadata": {}, "outputs": [], "source": [ @@ -535,7 +535,7 @@ { "cell_type": "code", "execution_count": null, - "id": "def1aa4d", + "id": "b7ec78c8", "metadata": {}, "outputs": [], "source": [ @@ -545,7 +545,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9b4ae78", + "id": "64dc974e", "metadata": {}, "outputs": [], "source": [ @@ -557,7 +557,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02ea8b3d", + "id": "006c57b3", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "61f8c7ff", + "id": "20d359ea", "metadata": {}, "source": [ "## Image overlay" @@ -585,7 +585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88ade3a8", + "id": "be608ba8", "metadata": {}, "outputs": [], "source": [ @@ -599,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c10086c2", + "id": "d9ea5bd7", "metadata": {}, "outputs": [], "source": [ @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61c75d93", + "id": "bc9ccc40", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6491fed8", + "id": "899b1582", "metadata": {}, "outputs": [], "source": [ @@ -634,7 +634,7 @@ }, { "cell_type": "markdown", - "id": "5651e5d9", + "id": "eb7eda96", "metadata": {}, "source": [ "## Video overlay" @@ -643,7 +643,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a2c2b29", + "id": "50990159", "metadata": {}, "outputs": [], "source": [ @@ -656,7 +656,7 @@ }, { "cell_type": "markdown", - "id": "59251ef1", + "id": "f096a6df", "metadata": {}, "source": [ "## Split-panel maps" @@ -665,7 +665,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5360ffc8", + "id": "3f12b8c0", "metadata": {}, "outputs": [], "source": [ @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90b0840a", + "id": "4d3b83d0", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +687,7 @@ { "cell_type": "code", "execution_count": null, - "id": "487599e2", + "id": "44064fd7", "metadata": {}, "outputs": [], "source": [ @@ -705,7 +705,7 @@ }, { "cell_type": "markdown", - "id": "2a84dc24", + "id": "5aa8bf7f", "metadata": {}, "source": [ "## Linked maps" @@ -714,7 +714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69b229a8", + "id": "63404e2f", "metadata": {}, "outputs": [], "source": [ @@ -754,7 +754,7 @@ }, { "cell_type": "markdown", - "id": "89b67eed", + "id": "7d699c21", "metadata": {}, "source": [ "## Timeseries inspector\n", @@ -765,7 +765,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c19287a", + "id": "80e321a3", "metadata": {}, "outputs": [], "source": [ @@ -779,7 +779,7 @@ { "cell_type": "code", "execution_count": null, - "id": "90bdefbc", + "id": "5ef5ac6f", "metadata": {}, "outputs": [], "source": [ @@ -797,7 +797,7 @@ }, { "cell_type": "markdown", - "id": "bf4412a2", + "id": "2fd5c019", "metadata": {}, "source": [ "### Visualizing planet.com imagery" @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ee567e8", + "id": "2d1f5457", "metadata": {}, "outputs": [], "source": [ @@ -818,7 +818,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64cf15e2", + "id": "ad9273dc", "metadata": {}, "outputs": [], "source": [ @@ -829,7 +829,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77c66448", + "id": "9dc9f6d8", "metadata": {}, "outputs": [], "source": [ @@ -840,7 +840,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1f8e07d", + "id": "8b12285d", "metadata": {}, "outputs": [], "source": [ @@ -851,7 +851,7 @@ { "cell_type": "code", "execution_count": null, - "id": "023a2046", + "id": "44db0754", "metadata": {}, "outputs": [], "source": [ @@ -861,7 +861,7 @@ }, { "cell_type": "markdown", - "id": "2b9a256f", + "id": "7f8cf75a", "metadata": {}, "source": [ "## Time slider\n", @@ -872,7 +872,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1001d3c", + "id": "3bdc4018", "metadata": {}, "outputs": [], "source": [ @@ -895,7 +895,7 @@ }, { "cell_type": "markdown", - "id": "7c3acafa", + "id": "b5e70065", "metadata": {}, "source": [ "### Visualizing weather data" @@ -904,7 +904,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46774d26", + "id": "91300fdd", "metadata": {}, "outputs": [], "source": [ @@ -930,7 +930,7 @@ }, { "cell_type": "markdown", - "id": "3398acec", + "id": "acd2724d", "metadata": {}, "source": [ "### Visualizing Sentinel-2 imagery" @@ -939,7 +939,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1bdc628", + "id": "119ac0b4", "metadata": {}, "outputs": [], "source": [ @@ -959,7 +959,7 @@ }, { "cell_type": "markdown", - "id": "7b1e9954", + "id": "b6c26014", "metadata": {}, "source": [ "## Shaded relief maps" @@ -968,7 +968,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3165d19b", + "id": "d0de0de0", "metadata": {}, "outputs": [], "source": [ @@ -993,7 +993,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da139f17", + "id": "7b024d3a", "metadata": {}, "outputs": [], "source": [ @@ -1005,7 +1005,7 @@ { "cell_type": "code", "execution_count": null, - "id": "070a2407", + "id": "0d80bb02", "metadata": {}, "outputs": [], "source": [ @@ -1021,7 +1021,7 @@ }, { "cell_type": "markdown", - "id": "b1409915", + "id": "aea2e09e", "metadata": {}, "source": [ "## Elevation contours" @@ -1030,7 +1030,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cad333a2", + "id": "cee4e03e", "metadata": {}, "outputs": [], "source": [ @@ -1040,7 +1040,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbab2c1b", + "id": "a5319392", "metadata": {}, "outputs": [], "source": [ @@ -1054,7 +1054,7 @@ { "cell_type": "code", "execution_count": null, - "id": "397192f6", + "id": "0204e85a", "metadata": {}, "outputs": [], "source": [ @@ -1066,7 +1066,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ddc9730", + "id": "8ca7c705", "metadata": {}, "outputs": [], "source": [ @@ -1077,7 +1077,7 @@ }, { "cell_type": "markdown", - "id": "ce669b86", + "id": "043ed8e4", "metadata": {}, "source": [ "## Visualizing NetCDF data" @@ -1086,7 +1086,7 @@ { "cell_type": "code", "execution_count": null, - "id": "560a6cc6", + "id": "7387ce66", "metadata": {}, "outputs": [], "source": [ @@ -1098,7 +1098,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c50b1dd", + "id": "a3ec2cdb", "metadata": {}, "outputs": [], "source": [ @@ -1109,7 +1109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc3d94a8", + "id": "8c8675b5", "metadata": {}, "outputs": [], "source": [ @@ -1130,7 +1130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f75778b", + "id": "9baf8c1d", "metadata": {}, "outputs": [], "source": [ @@ -1142,7 +1142,7 @@ }, { "cell_type": "markdown", - "id": "fb9800d1", + "id": "d7ebc8f1", "metadata": {}, "source": [ "## Visualizing LiDAR data" @@ -1151,7 +1151,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfd30c4a", + "id": "bcca8641", "metadata": {}, "outputs": [], "source": [ @@ -1161,7 +1161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86031f21", + "id": "0ba8f10f", "metadata": {}, "outputs": [], "source": [ @@ -1179,7 +1179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea367cb9", + "id": "faf5f35e", "metadata": {}, "outputs": [], "source": [ @@ -1189,7 +1189,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dd7a315", + "id": "fb396935", "metadata": {}, "outputs": [], "source": [ @@ -1199,7 +1199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0432d3d7", + "id": "fa7bea7d", "metadata": {}, "outputs": [], "source": [ @@ -1209,7 +1209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cbb0d35", + "id": "f2f61cb1", "metadata": {}, "outputs": [], "source": [ @@ -1219,7 +1219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6af951e9", + "id": "28c8d1d2", "metadata": {}, "outputs": [], "source": [ @@ -1229,7 +1229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1f5a6d9", + "id": "13445f3c", "metadata": {}, "outputs": [], "source": [ @@ -1239,7 +1239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b6246a0", + "id": "0e1cf9d0", "metadata": {}, "outputs": [], "source": [ @@ -1249,7 +1249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1cd92e2", + "id": "fdc3c51b", "metadata": {}, "outputs": [], "source": [ @@ -1258,7 +1258,7 @@ }, { "cell_type": "markdown", - "id": "aa5b7740", + "id": "f5bbc503", "metadata": {}, "source": [ "## Visualizing raster data in 3D" @@ -1267,7 +1267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fad4a40f", + "id": "25f48e13", "metadata": {}, "outputs": [], "source": [ @@ -1280,7 +1280,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7adc42b4", + "id": "c577691d", "metadata": {}, "outputs": [], "source": [ @@ -1290,7 +1290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c5df99c", + "id": "751bd4c5", "metadata": {}, "outputs": [], "source": [ @@ -1299,7 +1299,7 @@ }, { "cell_type": "markdown", - "id": "c9b613d7", + "id": "2e01dce6", "metadata": {}, "source": [ "## Creating choropleth maps" @@ -1308,7 +1308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8dd82938", + "id": "4b2eec7c", "metadata": {}, "outputs": [], "source": [ @@ -1318,7 +1318,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af433654", + "id": "9cf3aa2e", "metadata": {}, "outputs": [], "source": [ @@ -1332,7 +1332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fcd2797", + "id": "5838edf8", "metadata": {}, "outputs": [], "source": [ @@ -1350,7 +1350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ecfd6aa", + "id": "9e3310f1", "metadata": {}, "outputs": [], "source": [ @@ -1368,7 +1368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e0b2f78", + "id": "1d8f40fd", "metadata": {}, "outputs": [], "source": [ @@ -1385,7 +1385,7 @@ }, { "cell_type": "markdown", - "id": "2516248d", + "id": "32e20423", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/06_data_analysis.ipynb b/_sources/book/gee/06_data_analysis.ipynb index 57a0ccd..3482ede 100644 --- a/_sources/book/gee/06_data_analysis.ipynb +++ b/_sources/book/gee/06_data_analysis.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "70fc713b", + "id": "f29f29fb", "metadata": {}, "source": [ "# Analyzing Geospatial Data\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "afc36b23", + "id": "bd6917d4", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0150ca35", + "id": "9b9d233c", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65dbe942", + "id": "584cc6b8", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "be2fe49f", + "id": "0f86a8f4", "metadata": {}, "source": [ "## Earth Engine data reductions\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66d501b6", + "id": "8c350861", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b19568c", + "id": "5acf4a50", "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94d1cde5", + "id": "b45f1e7f", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6712aa1d", + "id": "2e001270", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c0c31ba", + "id": "a80ae309", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bcacfc1", + "id": "304af6d3", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c14c4ef", + "id": "463a5b63", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24cbe77d", + "id": "e34e3ec7", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7521c7bd", + "id": "0cc3ae02", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "d35d2eef", + "id": "a174daba", "metadata": {}, "source": [ "### ImageCollection reductions" @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "120b17a4", + "id": "4a844a6a", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f06c815c", + "id": "71ea6160", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ }, { "cell_type": "markdown", - "id": "9752b6b4", + "id": "39365796", "metadata": {}, "source": [ "### Image reductions" @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c47498f", + "id": "f1c512f5", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "0e3606f0", + "id": "60ce5660", "metadata": {}, "source": [ "### FeatureCollection reductions" @@ -250,7 +250,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a6f08cd", + "id": "d01d86b1", "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "435cfca0", + "id": "e19baedb", "metadata": {}, "outputs": [], "source": [ @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35d6e17e", + "id": "188936f5", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84355ede", + "id": "5495c119", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "e2f2a4ba", + "id": "c07a1d05", "metadata": {}, "source": [ "## Image descriptive statistics" @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58246b2a", + "id": "999f3b65", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c73f4f80", + "id": "f298be9c", "metadata": {}, "outputs": [], "source": [ @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd2aa4c3", + "id": "85e10bac", "metadata": {}, "outputs": [], "source": [ @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fef7eff9", + "id": "3606741b", "metadata": {}, "outputs": [], "source": [ @@ -360,7 +360,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3298e534", + "id": "50cc6d3f", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "1474e3fa", + "id": "092c7714", "metadata": {}, "source": [ "## Zonal statistics with Earth Engine\n", @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b8a8971", + "id": "267cb56a", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ccba300a", + "id": "daba33f6", "metadata": {}, "outputs": [], "source": [ @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "761aeee0", + "id": "d3e1ce40", "metadata": {}, "outputs": [], "source": [ @@ -441,7 +441,7 @@ }, { "cell_type": "markdown", - "id": "d20848aa", + "id": "bf715298", "metadata": {}, "source": [ "### Zonal statistics by group" @@ -450,7 +450,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca7f0463", + "id": "5da25e0a", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34a2f70b", + "id": "69f5ffe3", "metadata": {}, "outputs": [], "source": [ @@ -493,7 +493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4094adda", + "id": "eb426466", "metadata": {}, "outputs": [], "source": [ @@ -511,7 +511,7 @@ }, { "cell_type": "markdown", - "id": "24d73d31", + "id": "3fc4ce90", "metadata": {}, "source": [ "### Zonal statistics with two images" @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adb00fcc", + "id": "efa35c4d", "metadata": {}, "outputs": [], "source": [ @@ -534,7 +534,7 @@ { "cell_type": "code", "execution_count": null, - "id": "292075b6", + "id": "e62e2657", "metadata": {}, "outputs": [], "source": [ @@ -546,7 +546,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22b7a68d", + "id": "2da67287", "metadata": {}, "outputs": [], "source": [ @@ -557,7 +557,7 @@ { "cell_type": "code", "execution_count": null, - "id": "feedc9cb", + "id": "6f2968d1", "metadata": {}, "outputs": [], "source": [ @@ -567,7 +567,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6b10b7a", + "id": "5b86adda", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +576,7 @@ }, { "cell_type": "markdown", - "id": "c413a2ae", + "id": "1f4b01c5", "metadata": {}, "source": [ "## Coordinate grids and fishnets\n", @@ -587,7 +587,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1022a3b", + "id": "4ab9a567", "metadata": {}, "outputs": [], "source": [ @@ -597,7 +597,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1fba342b", + "id": "b9af3771", "metadata": {}, "outputs": [], "source": [ @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1525ca18", + "id": "0d5082a5", "metadata": {}, "outputs": [], "source": [ @@ -621,7 +621,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b28eae30", + "id": "db7019e4", "metadata": {}, "outputs": [], "source": [ @@ -631,7 +631,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d751905", + "id": "1443c6bf", "metadata": {}, "outputs": [], "source": [ @@ -644,7 +644,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46a74762", + "id": "723c58f3", "metadata": {}, "outputs": [], "source": [ @@ -656,7 +656,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1e3a01c", + "id": "47bd4866", "metadata": {}, "outputs": [], "source": [ @@ -668,7 +668,7 @@ }, { "cell_type": "markdown", - "id": "ae85420f", + "id": "4e050775", "metadata": {}, "source": [ "### Creating fishnets" @@ -677,7 +677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5021273", + "id": "6900dd1e", "metadata": {}, "outputs": [], "source": [ @@ -688,7 +688,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80515a2e", + "id": "83992b29", "metadata": {}, "outputs": [], "source": [ @@ -705,7 +705,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22e16308", + "id": "919c0c38", "metadata": {}, "outputs": [], "source": [ @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d425c768", + "id": "59710966", "metadata": {}, "outputs": [], "source": [ @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c56cfa41", + "id": "02b9f673", "metadata": {}, "outputs": [], "source": [ @@ -758,7 +758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "561a586f", + "id": "66643fec", "metadata": {}, "outputs": [], "source": [ @@ -769,7 +769,7 @@ }, { "cell_type": "markdown", - "id": "2f130b8a", + "id": "d37be45a", "metadata": {}, "source": [ "## Extracting pixel values\n", @@ -780,7 +780,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a9b6c12", + "id": "a9022aee", "metadata": {}, "outputs": [], "source": [ @@ -807,7 +807,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec083bf1", + "id": "dad9f5b2", "metadata": {}, "outputs": [], "source": [ @@ -819,7 +819,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73b40066", + "id": "eb5456e0", "metadata": {}, "outputs": [], "source": [ @@ -830,7 +830,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb2c7db5", + "id": "52416505", "metadata": {}, "outputs": [], "source": [ @@ -840,7 +840,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30dba559", + "id": "a38c7d62", "metadata": {}, "outputs": [], "source": [ @@ -850,7 +850,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03ca4a5b", + "id": "9781d133", "metadata": {}, "outputs": [], "source": [ @@ -860,7 +860,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0f6fcc9", + "id": "22f5fb5a", "metadata": {}, "outputs": [], "source": [ @@ -869,7 +869,7 @@ }, { "cell_type": "markdown", - "id": "4cd15395", + "id": "737cc9b3", "metadata": {}, "source": [ "### Extracting pixel values along a transect" @@ -878,7 +878,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9766ad10", + "id": "23e639f5", "metadata": {}, "outputs": [], "source": [ @@ -898,7 +898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45d01a15", + "id": "6463ef6a", "metadata": {}, "outputs": [], "source": [ @@ -914,7 +914,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6105ed5a", + "id": "c10a370d", "metadata": {}, "outputs": [], "source": [ @@ -928,7 +928,7 @@ { "cell_type": "code", "execution_count": null, - "id": "282b1577", + "id": "e487c6f1", "metadata": {}, "outputs": [], "source": [ @@ -946,7 +946,7 @@ { "cell_type": "code", "execution_count": null, - "id": "564af894", + "id": "53ed6d49", "metadata": {}, "outputs": [], "source": [ @@ -955,7 +955,7 @@ }, { "cell_type": "markdown", - "id": "c475937d", + "id": "f8cd9fc8", "metadata": {}, "source": [ "### Interactive region reduction" @@ -964,7 +964,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abc178dc", + "id": "d98af839", "metadata": {}, "outputs": [], "source": [ @@ -993,7 +993,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b42efe3b", + "id": "66891ef5", "metadata": {}, "outputs": [], "source": [ @@ -1004,7 +1004,7 @@ { "cell_type": "code", "execution_count": null, - "id": "378e94ae", + "id": "ec0189c5", "metadata": {}, "outputs": [], "source": [ @@ -1014,7 +1014,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b62ef51", + "id": "edd077e8", "metadata": {}, "outputs": [], "source": [ @@ -1026,7 +1026,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0543fec", + "id": "886233d6", "metadata": {}, "outputs": [], "source": [ @@ -1035,7 +1035,7 @@ }, { "cell_type": "markdown", - "id": "3e4cceec", + "id": "af6404cc", "metadata": {}, "source": [ "## Mapping available image count" @@ -1044,7 +1044,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62dbf146", + "id": "39d705c0", "metadata": {}, "outputs": [], "source": [ @@ -1057,7 +1057,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6de4f481", + "id": "5a212c90", "metadata": {}, "outputs": [], "source": [ @@ -1074,7 +1074,7 @@ }, { "cell_type": "markdown", - "id": "1c9cef78", + "id": "bac0b288", "metadata": {}, "source": [ "## Cloud-free composites" @@ -1083,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c114ec17", + "id": "a52b5d3b", "metadata": {}, "outputs": [], "source": [ @@ -1105,7 +1105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1b050b0", + "id": "10a2b915", "metadata": {}, "outputs": [], "source": [ @@ -1120,7 +1120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "742e601d", + "id": "7c6629c0", "metadata": {}, "outputs": [], "source": [ @@ -1142,7 +1142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "52780c47", + "id": "63d63bb2", "metadata": {}, "outputs": [], "source": [ @@ -1161,7 +1161,7 @@ }, { "cell_type": "markdown", - "id": "dd649d86", + "id": "4476e7a9", "metadata": {}, "source": [ "## Quality mosaicking" @@ -1170,7 +1170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c395da1e", + "id": "f6847369", "metadata": {}, "outputs": [], "source": [ @@ -1184,7 +1184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "335104e0", + "id": "7d5b316b", "metadata": {}, "outputs": [], "source": [ @@ -1200,7 +1200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbb16dc4", + "id": "c5cab2c7", "metadata": {}, "outputs": [], "source": [ @@ -1217,7 +1217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8df27a2", + "id": "88a5fba5", "metadata": {}, "outputs": [], "source": [ @@ -1229,7 +1229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3661c95c", + "id": "743ab8b2", "metadata": {}, "outputs": [], "source": [ @@ -1251,7 +1251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab36131b", + "id": "fab2e596", "metadata": {}, "outputs": [], "source": [ @@ -1261,7 +1261,7 @@ { "cell_type": "code", "execution_count": null, - "id": "719fae59", + "id": "cd50e83b", "metadata": {}, "outputs": [], "source": [ @@ -1271,7 +1271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "453dc11a", + "id": "d5416940", "metadata": {}, "outputs": [], "source": [ @@ -1281,7 +1281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4e5cef5", + "id": "fd1a5536", "metadata": {}, "outputs": [], "source": [ @@ -1295,7 +1295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00738a6e", + "id": "0137f260", "metadata": {}, "outputs": [], "source": [ @@ -1305,7 +1305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "774923ca", + "id": "81aa4ded", "metadata": {}, "outputs": [], "source": [ @@ -1317,7 +1317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dbc13d1", + "id": "11f2a4a7", "metadata": {}, "outputs": [], "source": [ @@ -1328,7 +1328,7 @@ }, { "cell_type": "markdown", - "id": "d97ea781", + "id": "a3ccf43c", "metadata": {}, "source": [ "## Interactive charts\n", @@ -1341,7 +1341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95d468b0", + "id": "69a4bd1c", "metadata": {}, "outputs": [], "source": [ @@ -1353,7 +1353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "565a769e", + "id": "f688a092", "metadata": {}, "outputs": [], "source": [ @@ -1374,7 +1374,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3cb03eb9", + "id": "d5733fcc", "metadata": {}, "outputs": [], "source": [ @@ -1393,7 +1393,7 @@ { "cell_type": "code", "execution_count": null, - "id": "84801cd1", + "id": "a1eeca02", "metadata": {}, "outputs": [], "source": [ @@ -1406,7 +1406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fae39975", + "id": "9d7a2d0a", "metadata": {}, "outputs": [], "source": [ @@ -1425,7 +1425,7 @@ }, { "cell_type": "markdown", - "id": "dc1450d6", + "id": "542d395b", "metadata": {}, "source": [ "### Earth Engine object charts" @@ -1434,7 +1434,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c8aab8a", + "id": "0dc731f2", "metadata": {}, "outputs": [], "source": [ @@ -1444,7 +1444,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9effb419", + "id": "7de9f6e0", "metadata": {}, "outputs": [], "source": [ @@ -1456,7 +1456,7 @@ }, { "cell_type": "markdown", - "id": "b4732e24", + "id": "d5aa4e42", "metadata": {}, "source": [ "#### Chart by feature" @@ -1465,7 +1465,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49ae79ca", + "id": "7d7b31d1", "metadata": {}, "outputs": [], "source": [ @@ -1477,7 +1477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9198f81", + "id": "4655b3cd", "metadata": {}, "outputs": [], "source": [ @@ -1520,7 +1520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43fa3372", + "id": "16f38363", "metadata": {}, "outputs": [], "source": [ @@ -1538,7 +1538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05cf7f69", + "id": "d67a75c6", "metadata": {}, "outputs": [], "source": [ @@ -1547,7 +1547,7 @@ }, { "cell_type": "markdown", - "id": "5bd61d69", + "id": "8386db38", "metadata": {}, "source": [ "#### Chart by property" @@ -1556,7 +1556,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85491b00", + "id": "67157f37", "metadata": {}, "outputs": [], "source": [ @@ -1568,7 +1568,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94238efc", + "id": "200ae6ec", "metadata": {}, "outputs": [], "source": [ @@ -1594,7 +1594,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3f58a87", + "id": "b963129f", "metadata": {}, "outputs": [], "source": [ @@ -1611,7 +1611,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91e365cc", + "id": "ea589bda", "metadata": {}, "outputs": [], "source": [ @@ -1620,7 +1620,7 @@ }, { "cell_type": "markdown", - "id": "82d3d61b", + "id": "bdfa64bd", "metadata": {}, "source": [ "#### Feature histograms" @@ -1629,7 +1629,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71da1fb3", + "id": "e1539995", "metadata": {}, "outputs": [], "source": [ @@ -1642,7 +1642,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1550c9f3", + "id": "65538266", "metadata": {}, "outputs": [], "source": [ @@ -1657,7 +1657,7 @@ { "cell_type": "code", "execution_count": null, - "id": "00cea322", + "id": "d3302254", "metadata": {}, "outputs": [], "source": [ @@ -1667,7 +1667,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fab3d6d5", + "id": "9cb2db72", "metadata": {}, "outputs": [], "source": [ @@ -1677,7 +1677,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eed74485", + "id": "00827e22", "metadata": {}, "outputs": [], "source": [ @@ -1687,7 +1687,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9657a0f0", + "id": "802acbcc", "metadata": {}, "outputs": [], "source": [ @@ -1696,7 +1696,7 @@ }, { "cell_type": "markdown", - "id": "45dc0918", + "id": "a94dc8a7", "metadata": {}, "source": [ "## Unsupervised classification" @@ -1705,7 +1705,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5509467b", + "id": "db2a173c", "metadata": {}, "outputs": [], "source": [ @@ -1734,7 +1734,7 @@ { "cell_type": "code", "execution_count": null, - "id": "016347ae", + "id": "7b387f7d", "metadata": {}, "outputs": [], "source": [ @@ -1744,7 +1744,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a47d8f5", + "id": "26bae36e", "metadata": {}, "outputs": [], "source": [ @@ -1754,7 +1754,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf1270b6", + "id": "34299238", "metadata": {}, "outputs": [], "source": [ @@ -1764,7 +1764,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c05d74f", + "id": "98baecb8", "metadata": {}, "outputs": [], "source": [ @@ -1785,7 +1785,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8cb7668", + "id": "f3de548e", "metadata": {}, "outputs": [], "source": [ @@ -1795,7 +1795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "991c1c90", + "id": "1ea82647", "metadata": {}, "outputs": [], "source": [ @@ -1806,7 +1806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b4cc9e6", + "id": "c960f64e", "metadata": {}, "outputs": [], "source": [ @@ -1818,7 +1818,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a68486d", + "id": "2d7334ed", "metadata": {}, "outputs": [], "source": [ @@ -1843,7 +1843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbc2f537", + "id": "1adabfed", "metadata": {}, "outputs": [], "source": [ @@ -1852,7 +1852,7 @@ }, { "cell_type": "markdown", - "id": "bc38c133", + "id": "90865ff9", "metadata": {}, "source": [ "## Supervised classification" @@ -1861,7 +1861,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b163169", + "id": "cbc9d55e", "metadata": {}, "outputs": [], "source": [ @@ -1888,7 +1888,7 @@ { "cell_type": "code", "execution_count": null, - "id": "76267c9d", + "id": "4e8d4743", "metadata": {}, "outputs": [], "source": [ @@ -1898,7 +1898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "317af79d", + "id": "b2e27496", "metadata": {}, "outputs": [], "source": [ @@ -1908,7 +1908,7 @@ { "cell_type": "code", "execution_count": null, - "id": "903cbefe", + "id": "2dbd38b6", "metadata": {}, "outputs": [], "source": [ @@ -1918,7 +1918,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1ca0b81", + "id": "4170154e", "metadata": {}, "outputs": [], "source": [ @@ -1931,7 +1931,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d9c5a5d", + "id": "1d16f192", "metadata": {}, "outputs": [], "source": [ @@ -1951,7 +1951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd83d997", + "id": "9576d4a0", "metadata": {}, "outputs": [], "source": [ @@ -1961,7 +1961,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86910baa", + "id": "6f6851a8", "metadata": {}, "outputs": [], "source": [ @@ -1975,7 +1975,7 @@ { "cell_type": "code", "execution_count": null, - "id": "beb70fdb", + "id": "d09ceb32", "metadata": {}, "outputs": [], "source": [ @@ -1985,7 +1985,7 @@ { "cell_type": "code", "execution_count": null, - "id": "377768ab", + "id": "dcd82ca6", "metadata": {}, "outputs": [], "source": [ @@ -2002,7 +2002,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a44a36e0", + "id": "1eaf70a8", "metadata": {}, "outputs": [], "source": [ @@ -2014,7 +2014,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6735a03", + "id": "74ac7177", "metadata": {}, "outputs": [], "source": [ @@ -2024,7 +2024,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9cc181c", + "id": "d8051c6c", "metadata": {}, "outputs": [], "source": [ @@ -2039,7 +2039,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5cfce44", + "id": "7a89d9a6", "metadata": {}, "outputs": [], "source": [ @@ -2051,7 +2051,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4785bdef", + "id": "d05bbd16", "metadata": {}, "outputs": [], "source": [ @@ -2065,7 +2065,7 @@ }, { "cell_type": "markdown", - "id": "04a94aa5", + "id": "0f4fd324", "metadata": {}, "source": [ "## Accuracy assessment" @@ -2074,7 +2074,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec56a8d8", + "id": "b8ca5199", "metadata": {}, "outputs": [], "source": [ @@ -2100,7 +2100,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfdfd544", + "id": "ec0d2910", "metadata": {}, "outputs": [], "source": [ @@ -2114,7 +2114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb07201e", + "id": "7d8b3288", "metadata": {}, "outputs": [], "source": [ @@ -2130,7 +2130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ed70a8d", + "id": "3a77e113", "metadata": {}, "outputs": [], "source": [ @@ -2142,7 +2142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63fc0684", + "id": "98a9ef86", "metadata": {}, "outputs": [], "source": [ @@ -2156,7 +2156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3e72170", + "id": "28cb9644", "metadata": {}, "outputs": [], "source": [ @@ -2166,7 +2166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfeaac98", + "id": "d8b2fcfb", "metadata": {}, "outputs": [], "source": [ @@ -2177,7 +2177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70b73617", + "id": "47a025ff", "metadata": {}, "outputs": [], "source": [ @@ -2187,7 +2187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce0329cb", + "id": "48b8c3fa", "metadata": {}, "outputs": [], "source": [ @@ -2197,7 +2197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aeb2a432", + "id": "c23b4dff", "metadata": {}, "outputs": [], "source": [ @@ -2209,7 +2209,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a5783fbb", + "id": "d7385aee", "metadata": {}, "outputs": [], "source": [ @@ -2219,7 +2219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "589cde70", + "id": "2b70d71e", "metadata": {}, "outputs": [], "source": [ @@ -2229,7 +2229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b93fc95", + "id": "917edb74", "metadata": {}, "outputs": [], "source": [ @@ -2239,7 +2239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e030480", + "id": "156bd1b0", "metadata": {}, "outputs": [], "source": [ @@ -2257,7 +2257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdfb9862", + "id": "b66603b4", "metadata": {}, "outputs": [], "source": [ @@ -2267,7 +2267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8457282", + "id": "8a0082f1", "metadata": {}, "outputs": [], "source": [ @@ -2288,7 +2288,7 @@ }, { "cell_type": "markdown", - "id": "b33fca3c", + "id": "7c05cd76", "metadata": {}, "source": [ "## Using locally trained machine learning models" @@ -2297,7 +2297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "161836b7", + "id": "9f0ffe06", "metadata": {}, "outputs": [], "source": [ @@ -2308,7 +2308,7 @@ }, { "cell_type": "markdown", - "id": "03e8d7a3", + "id": "4f956af1", "metadata": {}, "source": [ "### Train a model locally using scikit-learn" @@ -2317,7 +2317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2335f58", + "id": "ad2187a1", "metadata": {}, "outputs": [], "source": [ @@ -2329,7 +2329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "941fe777", + "id": "58072ac9", "metadata": {}, "outputs": [], "source": [ @@ -2340,7 +2340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b11c8545", + "id": "17324f5e", "metadata": {}, "outputs": [], "source": [ @@ -2352,7 +2352,7 @@ }, { "cell_type": "markdown", - "id": "b837d600", + "id": "9a08eeb8", "metadata": {}, "source": [ "### Convert a sklearn classifier object to a list of strings" @@ -2361,7 +2361,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e723b525", + "id": "c3c2dd46", "metadata": {}, "outputs": [], "source": [ @@ -2371,7 +2371,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2782fb83", + "id": "13584e30", "metadata": {}, "outputs": [], "source": [ @@ -2381,7 +2381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75f36957", + "id": "9117305e", "metadata": {}, "outputs": [], "source": [ @@ -2390,7 +2390,7 @@ }, { "cell_type": "markdown", - "id": "675c7f29", + "id": "c20a269f", "metadata": {}, "source": [ "### Convert sklearn classifier to GEE classifier" @@ -2399,7 +2399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9885bbf4", + "id": "3650eac5", "metadata": {}, "outputs": [], "source": [ @@ -2409,7 +2409,7 @@ }, { "cell_type": "markdown", - "id": "754c1f2c", + "id": "493eea89", "metadata": {}, "source": [ "### Classify image using GEE classifier" @@ -2418,7 +2418,7 @@ { "cell_type": "code", "execution_count": null, - "id": "acd961ed", + "id": "c6049ef7", "metadata": {}, "outputs": [], "source": [ @@ -2433,7 +2433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c4a8064", + "id": "fbf86183", "metadata": {}, "outputs": [], "source": [ @@ -2443,7 +2443,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c451ae69", + "id": "bf3e3b69", "metadata": {}, "outputs": [], "source": [ @@ -2464,7 +2464,7 @@ }, { "cell_type": "markdown", - "id": "0ba3d647", + "id": "731126bb", "metadata": {}, "source": [ "### Save trees to the cloud" @@ -2473,7 +2473,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b69896c9", + "id": "97695b14", "metadata": {}, "outputs": [], "source": [ @@ -2485,7 +2485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b26c509a", + "id": "75987793", "metadata": {}, "outputs": [], "source": [ @@ -2495,7 +2495,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71c57803", + "id": "4176b7c0", "metadata": {}, "outputs": [], "source": [ @@ -2506,7 +2506,7 @@ }, { "cell_type": "markdown", - "id": "6db065e6", + "id": "6edbcaad", "metadata": {}, "source": [ "### Save trees locally" @@ -2515,7 +2515,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01b19625", + "id": "52684dc2", "metadata": {}, "outputs": [], "source": [ @@ -2527,7 +2527,7 @@ }, { "cell_type": "markdown", - "id": "eae795b4", + "id": "9eb2a227", "metadata": {}, "source": [ "## Sankey diagrams" @@ -2536,7 +2536,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fd5dbe5", + "id": "3ff1fbec", "metadata": {}, "outputs": [], "source": [ @@ -2553,7 +2553,7 @@ { "cell_type": "code", "execution_count": null, - "id": "217ab9fc", + "id": "31dd1373", "metadata": {}, "outputs": [], "source": [ @@ -2563,7 +2563,7 @@ }, { "cell_type": "markdown", - "id": "09505621", + "id": "1df87cb3", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/07_data_export.ipynb b/_sources/book/gee/07_data_export.ipynb index b9f4c20..87e2202 100644 --- a/_sources/book/gee/07_data_export.ipynb +++ b/_sources/book/gee/07_data_export.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fb631d39", + "id": "c912122d", "metadata": {}, "source": [ "# Exporting Earth Engine Data\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "9233dff5", + "id": "77514913", "metadata": {}, "source": [ "## Technical requirements\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4caf5461", + "id": "0c1f8d8d", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d8277b0", + "id": "7d44422f", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dc2305e", + "id": "dedd223a", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "f9b4ea49", + "id": "9e38b1a2", "metadata": {}, "source": [ "## Exporting images" @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97010097", + "id": "58717fa5", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e781b79a", + "id": "50f2342f", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ }, { "cell_type": "markdown", - "id": "142dbeae", + "id": "153bd121", "metadata": {}, "source": [ "### To local drive" @@ -118,7 +118,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53c843cf", + "id": "d5dca806", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58adba7d", + "id": "cc3b1c7e", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "252f2efa", + "id": "b5976c25", "metadata": {}, "outputs": [], "source": [ @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27d0fee6", + "id": "e4406362", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b38b00b", + "id": "73ba9dff", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd45181b", + "id": "3a70206a", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ { "cell_type": "code", "execution_count": null, - "id": "694e64cd", + "id": "fb9b620c", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "3d2a8c01", + "id": "9737973c", "metadata": {}, "source": [ "### To Google Drive" @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d776e651", + "id": "c13d5a5e", "metadata": {}, "outputs": [], "source": [ @@ -221,7 +221,7 @@ }, { "cell_type": "markdown", - "id": "d555befc", + "id": "707efc86", "metadata": {}, "source": [ "### To Asset" @@ -230,7 +230,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c72a7e8f", + "id": "0d900387", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "033324ee", + "id": "594cc379", "metadata": {}, "source": [ "### To Cloud Storage" @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c957acdb", + "id": "f1c35653", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "894ce4e6", + "id": "c8240dbe", "metadata": {}, "source": [ "### To NumPy array" @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2faf5bda", + "id": "ea18095c", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e58b279", + "id": "ec4ffbb4", "metadata": {}, "outputs": [], "source": [ @@ -293,7 +293,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2927df88", + "id": "266e9c21", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ }, { "cell_type": "markdown", - "id": "c3bb962b", + "id": "ff24b6ab", "metadata": {}, "source": [ "## Exporting image collections" @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "201cf064", + "id": "4405b58e", "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6363d6e", + "id": "1f5941f8", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "b7349208", + "id": "225f9126", "metadata": {}, "source": [ "### To local drive" @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b6ad4f2", + "id": "1398295f", "metadata": {}, "outputs": [], "source": [ @@ -359,7 +359,7 @@ }, { "cell_type": "markdown", - "id": "cd11c9a2", + "id": "06d69e23", "metadata": {}, "source": [ "### To Google Drive" @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45dae40c", + "id": "39729e8c", "metadata": {}, "outputs": [], "source": [ @@ -377,7 +377,7 @@ }, { "cell_type": "markdown", - "id": "026d28cb", + "id": "bb168808", "metadata": {}, "source": [ "### To Assets" @@ -386,7 +386,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cad7843", + "id": "3d1ccb65", "metadata": {}, "outputs": [], "source": [ @@ -395,7 +395,7 @@ }, { "cell_type": "markdown", - "id": "8c71424a", + "id": "633fca93", "metadata": {}, "source": [ "## Exporting videos" @@ -404,7 +404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "895c9432", + "id": "ce23109a", "metadata": {}, "outputs": [], "source": [ @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c139dfd2", + "id": "3c7ca6f1", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "749a3ec8", + "id": "cc21717b", "metadata": {}, "source": [ "## Exporting image thumbnails" @@ -443,7 +443,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12f48f93", + "id": "bb520e16", "metadata": {}, "outputs": [], "source": [ @@ -461,7 +461,7 @@ { "cell_type": "code", "execution_count": null, - "id": "870ca4ee", + "id": "2465d311", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "262b1892", + "id": "7cea2ce1", "metadata": {}, "outputs": [], "source": [ @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8feb712", + "id": "588c4ba2", "metadata": {}, "outputs": [], "source": [ @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d09717bb", + "id": "65801946", "metadata": {}, "outputs": [], "source": [ @@ -520,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "569a9c9a", + "id": "ad12918d", "metadata": {}, "source": [ "## Exporting feature collections" @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "177964b7", + "id": "84983603", "metadata": {}, "outputs": [], "source": [ @@ -545,7 +545,7 @@ }, { "cell_type": "markdown", - "id": "2ec570b9", + "id": "98ba9f55", "metadata": {}, "source": [ "### To local drive" @@ -554,7 +554,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8706f14a", + "id": "7c390ce3", "metadata": {}, "outputs": [], "source": [ @@ -564,7 +564,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef93d9e3", + "id": "2e5c80eb", "metadata": {}, "outputs": [], "source": [ @@ -574,7 +574,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df89e07b", + "id": "b9ae69e5", "metadata": {}, "outputs": [], "source": [ @@ -584,7 +584,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6804747", + "id": "d48068e4", "metadata": {}, "outputs": [], "source": [ @@ -594,7 +594,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a9ecc17", + "id": "f77e3827", "metadata": {}, "outputs": [], "source": [ @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44e479a4", + "id": "38a08c86", "metadata": {}, "outputs": [], "source": [ @@ -615,7 +615,7 @@ }, { "cell_type": "markdown", - "id": "52283c4c", + "id": "8c6fecc6", "metadata": {}, "source": [ "### To Google Drive" @@ -624,7 +624,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c60fc4de", + "id": "aca36c8d", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +635,7 @@ }, { "cell_type": "markdown", - "id": "91abf5a9", + "id": "28af5b9d", "metadata": {}, "source": [ "### To Asset" @@ -644,7 +644,7 @@ { "cell_type": "code", "execution_count": null, - "id": "353e53a8", + "id": "cc7273a2", "metadata": {}, "outputs": [], "source": [ @@ -653,7 +653,7 @@ }, { "cell_type": "markdown", - "id": "05f4e3e6", + "id": "6242d3c3", "metadata": {}, "source": [ "## Exporting maps" @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "495341b2", + "id": "e8538f2d", "metadata": {}, "outputs": [], "source": [ @@ -680,7 +680,7 @@ { "cell_type": "code", "execution_count": null, - "id": "66d869ca", + "id": "a7b7cf8e", "metadata": {}, "outputs": [], "source": [ @@ -691,7 +691,7 @@ }, { "cell_type": "markdown", - "id": "e538064f", + "id": "5aee7cc1", "metadata": {}, "source": [ "## Using the high-volume endpoint" @@ -700,7 +700,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da67122f", + "id": "6c6b1c95", "metadata": {}, "outputs": [], "source": [ @@ -717,7 +717,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e78dd44", + "id": "92f5ec5e", "metadata": {}, "outputs": [], "source": [ @@ -727,7 +727,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6f57510", + "id": "5766b560", "metadata": {}, "outputs": [], "source": [ @@ -752,7 +752,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cfb91b11", + "id": "849d9e03", "metadata": {}, "outputs": [], "source": [ @@ -769,7 +769,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ca005a5", + "id": "ec1cedb8", "metadata": {}, "outputs": [], "source": [ @@ -783,7 +783,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ba9a7da", + "id": "7fd41b09", "metadata": {}, "outputs": [], "source": [ @@ -804,7 +804,7 @@ { "cell_type": "code", "execution_count": null, - "id": "50028cf1", + "id": "b82296d3", "metadata": {}, "outputs": [], "source": [ @@ -824,7 +824,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0798354b", + "id": "41dc3404", "metadata": {}, "outputs": [], "source": [ @@ -870,7 +870,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a8d334f", + "id": "f844b70c", "metadata": {}, "outputs": [], "source": [ @@ -887,7 +887,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12839574", + "id": "acb52b7b", "metadata": {}, "outputs": [], "source": [ @@ -898,7 +898,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adc9d374", + "id": "a7b8147b", "metadata": {}, "outputs": [], "source": [ @@ -907,7 +907,7 @@ }, { "cell_type": "markdown", - "id": "461b6be7", + "id": "cbbed36a", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/08_cartoee.ipynb b/_sources/book/gee/08_cartoee.ipynb index d6480d6..0ffb1e1 100644 --- a/_sources/book/gee/08_cartoee.ipynb +++ b/_sources/book/gee/08_cartoee.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9408442c", + "id": "6b62b744", "metadata": {}, "source": [ "# Making Maps with Cartoee\n", @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc625e77", + "id": "e10f7993", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0796aa89", + "id": "8be8ac39", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25b3adc7", + "id": "1332085e", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "05562136", + "id": "8d9af174", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e1fbcf2", + "id": "6459bd17", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "918187fe", + "id": "8e9c4b8f", "metadata": {}, "source": [ "## Plotting single-band images" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c70af895", + "id": "3ec0ae77", "metadata": {}, "outputs": [], "source": [ @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df9bcc8c", + "id": "6ffd0be2", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd1a2a5b", + "id": "3a3f5d9b", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2855526", + "id": "0bf459aa", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "f26f97bd", + "id": "30db80d0", "metadata": {}, "source": [ "## Plotting multi-band images" @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "217ada62", + "id": "9de5b207", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04b7c898", + "id": "6469e4c5", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7a4b40a", + "id": "a2a1d868", "metadata": {}, "outputs": [], "source": [ @@ -215,7 +215,7 @@ }, { "cell_type": "markdown", - "id": "ff498937", + "id": "0fa97e7b", "metadata": {}, "source": [ "## Adding north arrows and scale bars" @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "411f1b29", + "id": "3b0159ec", "metadata": {}, "outputs": [], "source": [ @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16b58b6f", + "id": "3cb69a18", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "362f4f93", + "id": "5c48c20e", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +308,7 @@ }, { "cell_type": "markdown", - "id": "a1f038ef", + "id": "923ff562", "metadata": {}, "source": [ "## Adding legends" @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd24c24", + "id": "dadc7e9d", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a531f4d", + "id": "f9657d70", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1567258", + "id": "2ed4ead9", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a63797a", + "id": "ae2cd100", "metadata": {}, "outputs": [], "source": [ @@ -403,7 +403,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8327f8cb", + "id": "2191599d", "metadata": {}, "outputs": [], "source": [ @@ -422,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3e6d846", + "id": "7de51a30", "metadata": {}, "outputs": [], "source": [ @@ -431,7 +431,7 @@ }, { "cell_type": "markdown", - "id": "f3dcb6b6", + "id": "abfc65ae", "metadata": {}, "source": [ "## Adding basemaps" @@ -440,7 +440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e1432e8", + "id": "f7af06f0", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0499a5eb", + "id": "67a20169", "metadata": {}, "outputs": [], "source": [ @@ -469,7 +469,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ab21144", + "id": "a33301ed", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +488,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd814b0d", + "id": "e677960f", "metadata": {}, "outputs": [], "source": [ @@ -505,7 +505,7 @@ }, { "cell_type": "markdown", - "id": "7c0c8b52", + "id": "d84c19de", "metadata": {}, "source": [ "## Using custom projections\n", @@ -516,7 +516,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0185ee38", + "id": "ac255c74", "metadata": {}, "outputs": [], "source": [ @@ -531,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18799132", + "id": "1ab63451", "metadata": {}, "outputs": [], "source": [ @@ -542,7 +542,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fb896cc", + "id": "a19e1d87", "metadata": {}, "outputs": [], "source": [ @@ -560,7 +560,7 @@ { "cell_type": "code", "execution_count": null, - "id": "305e1e65", + "id": "d2b8aec3", "metadata": {}, "outputs": [], "source": [ @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "6b3756b8", + "id": "7d3afc12", "metadata": {}, "source": [ "### Custom projections" @@ -578,7 +578,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9b01120", + "id": "c63a07f2", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +588,7 @@ { "cell_type": "code", "execution_count": null, - "id": "599c7a52", + "id": "133444ee", "metadata": {}, "outputs": [], "source": [ @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e192552", + "id": "3bf64d19", "metadata": {}, "outputs": [], "source": [ @@ -632,7 +632,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74158f51", + "id": "e55281e4", "metadata": {}, "outputs": [], "source": [ @@ -654,7 +654,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35086f9b", + "id": "20313478", "metadata": {}, "outputs": [], "source": [ @@ -676,7 +676,7 @@ { "cell_type": "code", "execution_count": null, - "id": "287153ff", + "id": "643873a0", "metadata": {}, "outputs": [], "source": [ @@ -697,7 +697,7 @@ }, { "cell_type": "markdown", - "id": "0f45c14b", + "id": "b33bd8ed", "metadata": {}, "source": [ "### The warping artifacts" @@ -706,7 +706,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d85d3db7", + "id": "5f8d528e", "metadata": {}, "outputs": [], "source": [ @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08f1203c", + "id": "f3d9e4fc", "metadata": {}, "outputs": [], "source": [ @@ -756,7 +756,7 @@ }, { "cell_type": "markdown", - "id": "2f5a3c27", + "id": "16e96f8c", "metadata": {}, "source": [ "## Plotting multiple Earth Engine layers\n", @@ -767,7 +767,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9dfb1bb8", + "id": "5059b6e3", "metadata": {}, "outputs": [], "source": [ @@ -797,7 +797,7 @@ }, { "cell_type": "markdown", - "id": "9d43bdb9", + "id": "f6da6148", "metadata": {}, "source": [ "### Plotting a blended image with the default projection" @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "971dff80", + "id": "9d339e95", "metadata": {}, "outputs": [], "source": [ @@ -822,7 +822,7 @@ }, { "cell_type": "markdown", - "id": "6d62d021", + "id": "286818a0", "metadata": {}, "source": [ "### Plotting a blended image with a custom projection" @@ -831,7 +831,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0475353", + "id": "055b89d7", "metadata": {}, "outputs": [], "source": [ @@ -841,7 +841,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7732e99b", + "id": "ae740e20", "metadata": {}, "outputs": [], "source": [ @@ -857,7 +857,7 @@ }, { "cell_type": "markdown", - "id": "191822f0", + "id": "0899f4dd", "metadata": {}, "source": [ "## Creating timelapse animations\n", @@ -868,7 +868,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5db36f7", + "id": "591bc54b", "metadata": {}, "outputs": [], "source": [ @@ -903,7 +903,7 @@ }, { "cell_type": "markdown", - "id": "001a5fc8", + "id": "4b27dcb4", "metadata": {}, "source": [ "### Displaying a sample image" @@ -912,7 +912,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6a75794", + "id": "8113dd42", "metadata": {}, "outputs": [], "source": [ @@ -928,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "343e2af5", + "id": "37335486", "metadata": {}, "source": [ "### Getting a sample output image" @@ -937,7 +937,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9246818", + "id": "aa9606b1", "metadata": {}, "outputs": [], "source": [ @@ -984,7 +984,7 @@ }, { "cell_type": "markdown", - "id": "d4db6c0f", + "id": "84bceb02", "metadata": {}, "source": [ "### Creating timelapse" @@ -993,7 +993,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc38b7a2", + "id": "4b0865b8", "metadata": {}, "outputs": [], "source": [ @@ -1020,7 +1020,7 @@ }, { "cell_type": "markdown", - "id": "67c4c871", + "id": "461b1aed", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/09_timelapse.ipynb b/_sources/book/gee/09_timelapse.ipynb index 792d059..c6d166c 100644 --- a/_sources/book/gee/09_timelapse.ipynb +++ b/_sources/book/gee/09_timelapse.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "79802d02", + "id": "bda8c91e", "metadata": {}, "source": [ "# Creating Timelapse Animations\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "e0a6d978", + "id": "9c846567", "metadata": {}, "source": [ "## Technical requirements\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8418412", + "id": "ac09eed1", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08b52339", + "id": "6825135f", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "07c10a4f", + "id": "e2fc07ec", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "45027c62", + "id": "fa1e126f", "metadata": {}, "source": [ "## The map function" @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7d1ea8f", + "id": "e69c3ad6", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c84ecd5", + "id": "ab7a9ae2", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b597c7bd", + "id": "82655c50", "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ }, { "cell_type": "markdown", - "id": "d2192b11", + "id": "ddbc428d", "metadata": {}, "source": [ "## Creating cloud-free composites" @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26d55a5c", + "id": "e98b5387", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1ee79e7", + "id": "bc58fd5d", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "343e1e51", + "id": "73154406", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2a32a3f", + "id": "70b8534c", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "336cf618", + "id": "5dfaa25d", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "18233f8f", + "id": "10e60b8b", "metadata": {}, "source": [ "## Creating time series" @@ -204,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95ea515d", + "id": "1c6679de", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b28f7466", + "id": "1d6abe9b", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7dc8847", + "id": "e3d536eb", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6e55c7f", + "id": "61882988", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "91448171", + "id": "cfdfc7ef", "metadata": {}, "source": [ "## NAIP timelapse" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7374f5e5", + "id": "db3cdded", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e30812a", + "id": "c379caac", "metadata": {}, "outputs": [], "source": [ @@ -292,7 +292,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa4a2738", + "id": "3043bf20", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae88729a", + "id": "5cf4ec91", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac378193", + "id": "e1a1e906", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d874d26a", + "id": "41ee60c4", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "192340bf", + "id": "758edd06", "metadata": {}, "source": [ "## Landsat timelapse" @@ -353,7 +353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "611ea547", + "id": "5c149923", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dee4d96", + "id": "56403b79", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc148208", + "id": "edffb862", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fefbe2f9", + "id": "ce03010d", "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0a30de7", + "id": "a9300ae0", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +435,7 @@ { "cell_type": "code", "execution_count": null, - "id": "910ae8cb", + "id": "30b1b8e0", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +449,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54800097", + "id": "7baa3b69", "metadata": {}, "outputs": [], "source": [ @@ -469,7 +469,7 @@ }, { "cell_type": "markdown", - "id": "888e2bc4", + "id": "2b14cbc3", "metadata": {}, "source": [ "## Sentinel-1 timelapse" @@ -478,7 +478,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd865e45", + "id": "7009695b", "metadata": {}, "outputs": [], "source": [ @@ -489,7 +489,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ee01835", + "id": "24469ced", "metadata": {}, "outputs": [], "source": [ @@ -503,7 +503,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c092471", + "id": "a79e51bd", "metadata": {}, "outputs": [], "source": [ @@ -528,7 +528,7 @@ }, { "cell_type": "markdown", - "id": "df25fbb4", + "id": "496dbd87", "metadata": {}, "source": [ "## Sentinel-2 timelapse" @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c548472f", + "id": "1c60adc4", "metadata": {}, "outputs": [], "source": [ @@ -548,7 +548,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e818e8ab", + "id": "7492406d", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3c3eb66", + "id": "7613b8e3", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ }, { "cell_type": "markdown", - "id": "1544b232", + "id": "38a8b5fb", "metadata": {}, "source": [ "## MODIS timelapse\n", @@ -594,7 +594,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbf690c5", + "id": "06474894", "metadata": {}, "outputs": [], "source": [ @@ -605,7 +605,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67685c5a", + "id": "a57d0e00", "metadata": {}, "outputs": [], "source": [ @@ -619,7 +619,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba479792", + "id": "4354069e", "metadata": {}, "outputs": [], "source": [ @@ -639,7 +639,7 @@ }, { "cell_type": "markdown", - "id": "5aff0155", + "id": "b24a41b7", "metadata": {}, "source": [ "### MODIS temperature" @@ -648,7 +648,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5bc8aa93", + "id": "2b2b8801", "metadata": {}, "outputs": [], "source": [ @@ -659,7 +659,7 @@ { "cell_type": "code", "execution_count": null, - "id": "801312aa", + "id": "c2a79dbf", "metadata": {}, "outputs": [], "source": [ @@ -673,7 +673,7 @@ { "cell_type": "code", "execution_count": null, - "id": "963e12c4", + "id": "9cb2b130", "metadata": {}, "outputs": [], "source": [ @@ -693,7 +693,7 @@ }, { "cell_type": "markdown", - "id": "2ef59f91", + "id": "db54e318", "metadata": {}, "source": [ "## GOES timelapse" @@ -702,7 +702,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8ab9893", + "id": "9a23d40f", "metadata": {}, "outputs": [], "source": [ @@ -716,7 +716,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15eb9e69", + "id": "309d2c1d", "metadata": {}, "outputs": [], "source": [ @@ -729,7 +729,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fae2cd7f", + "id": "49ad9cb5", "metadata": {}, "outputs": [], "source": [ @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "271913f5", + "id": "347cee05", "metadata": {}, "outputs": [], "source": [ @@ -756,7 +756,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74639cae", + "id": "ccb31d99", "metadata": {}, "outputs": [], "source": [ @@ -770,7 +770,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1cc7cf9", + "id": "e8d6c65b", "metadata": {}, "outputs": [], "source": [ @@ -782,7 +782,7 @@ }, { "cell_type": "markdown", - "id": "7ccddc7d", + "id": "f605fd05", "metadata": {}, "source": [ "## Fading effects" @@ -791,7 +791,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a45e9d20", + "id": "0f49670b", "metadata": {}, "outputs": [], "source": [ @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b041eeef", + "id": "69fad761", "metadata": {}, "outputs": [], "source": [ @@ -814,7 +814,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c18b9b1", + "id": "136e7ce6", "metadata": {}, "outputs": [], "source": [ @@ -833,7 +833,7 @@ }, { "cell_type": "markdown", - "id": "67729910", + "id": "28f7f2aa", "metadata": {}, "source": [ "## Adding text to timelapse" @@ -842,7 +842,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1c9cc37", + "id": "e3d6dc1b", "metadata": {}, "outputs": [], "source": [ @@ -855,7 +855,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd4cc051", + "id": "620b745b", "metadata": {}, "outputs": [], "source": [ @@ -879,7 +879,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d80e2a7", + "id": "8e0cb813", "metadata": {}, "outputs": [], "source": [ @@ -891,7 +891,7 @@ }, { "cell_type": "markdown", - "id": "2a7a67d5", + "id": "8314b66c", "metadata": {}, "source": [ "## Adding image and colorbar to timelapse\n", @@ -902,7 +902,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ac621de", + "id": "1fad18e8", "metadata": {}, "outputs": [], "source": [ @@ -934,7 +934,7 @@ }, { "cell_type": "markdown", - "id": "b7aeb039", + "id": "a9ead4f5", "metadata": {}, "source": [ "### Adding animated text" @@ -943,7 +943,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7b5cc41", + "id": "4e45cfa1", "metadata": {}, "outputs": [], "source": [ @@ -970,7 +970,7 @@ }, { "cell_type": "markdown", - "id": "824f1699", + "id": "bba586a3", "metadata": {}, "source": [ "### Adding logo" @@ -979,7 +979,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3025fe1b", + "id": "1d6e618a", "metadata": {}, "outputs": [], "source": [ @@ -997,7 +997,7 @@ }, { "cell_type": "markdown", - "id": "9d36e823", + "id": "f7c72ecd", "metadata": {}, "source": [ "### Adding colorbar" @@ -1006,7 +1006,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c80e9457", + "id": "ea5fcc26", "metadata": {}, "outputs": [], "source": [ @@ -1018,7 +1018,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bac9a07d", + "id": "f0ceeeab", "metadata": {}, "outputs": [], "source": [ @@ -1030,7 +1030,7 @@ }, { "cell_type": "markdown", - "id": "7ed3baab", + "id": "28abb658", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/10_webapps.ipynb b/_sources/book/gee/10_webapps.ipynb index a52ff83..36cf8bd 100644 --- a/_sources/book/gee/10_webapps.ipynb +++ b/_sources/book/gee/10_webapps.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "38bf718e", + "id": "6b955956", "metadata": {}, "source": [ "# Building Interactive Web Apps\n", @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14fa1d00", + "id": "409b2158", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21665d82", + "id": "b9decb57", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55223ea4", + "id": "a97a34f3", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "278bdf08", + "id": "d19abffe", "metadata": {}, "source": [ "## Building JavaScript web apps\n", @@ -249,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33576736", + "id": "eadf47f5", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9db80b7a", + "id": "d076653d", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b00320e", + "id": "da993590", "metadata": {}, "outputs": [], "source": [ @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f87df37", + "id": "82a0ea13", "metadata": {}, "outputs": [], "source": [ @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e003e825", + "id": "43ec4529", "metadata": {}, "outputs": [], "source": [ @@ -305,7 +305,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e750f9e3", + "id": "df5567b0", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fdcaf4c", + "id": "f67b53d9", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5559b5f5", + "id": "0f4d0034", "metadata": {}, "outputs": [], "source": [ @@ -339,7 +339,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7865081", + "id": "081f0223", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a55ab0d", + "id": "a87a3260", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "92391f25", + "id": "f7a8df5c", "metadata": {}, "source": [ "## Using Voila to deploy web apps\n", @@ -420,7 +420,7 @@ { "cell_type": "code", "execution_count": null, - "id": "299e314c", + "id": "25965070", "metadata": {}, "outputs": [], "source": [ @@ -432,7 +432,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67b2124f", + "id": "da2a9ca2", "metadata": {}, "outputs": [], "source": [ @@ -446,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecf52f3f", + "id": "87fc3927", "metadata": {}, "outputs": [], "source": [ @@ -472,7 +472,7 @@ }, { "cell_type": "markdown", - "id": "3244b436", + "id": "3d4e50a0", "metadata": {}, "source": [ "```bash\n", @@ -490,7 +490,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e0b932d", + "id": "ab5bc2f8", "metadata": {}, "outputs": [], "source": [ @@ -538,7 +538,7 @@ }, { "cell_type": "markdown", - "id": "8c1ffe5f", + "id": "650860a9", "metadata": {}, "source": [ "```bash\n", @@ -552,7 +552,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb093499", + "id": "c2fbaa3a", "metadata": {}, "outputs": [], "source": [ @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "99e8bc8e", + "id": "f2516c99", "metadata": {}, "source": [ "## Summary" diff --git a/_sources/book/gee/11_applications.ipynb b/_sources/book/gee/11_applications.ipynb index 8409e0a..b1ed293 100644 --- a/_sources/book/gee/11_applications.ipynb +++ b/_sources/book/gee/11_applications.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "44f80cfa", + "id": "96e80641", "metadata": {}, "source": [ "# Earth Engine Applications\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10ff41e2", + "id": "8e66cda3", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35524259", + "id": "5951593c", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46fdf60b", + "id": "4226db9b", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "7b786371", + "id": "1d69e4fd", "metadata": {}, "source": [ "## Analyzing surface water dynamics\n", @@ -72,7 +72,7 @@ { "cell_type": "code", "execution_count": null, - "id": "512599c7", + "id": "4af37d82", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b8e5f82", + "id": "5c5a735d", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a27f80d3", + "id": "671d4ea7", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30addbc9", + "id": "7da44d8e", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c3a86700", + "id": "f10048a6", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8dabda1", + "id": "a7bf9ecc", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "ca720904", + "id": "817248de", "metadata": {}, "source": [ "### Surface water monthly history" @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d655176", + "id": "fcb75a54", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7053dd5b", + "id": "81566618", "metadata": {}, "outputs": [], "source": [ @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46764461", + "id": "4089c2ee", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80af3774", + "id": "02ee2592", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98fbb1be", + "id": "7da3a09c", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9a22650", + "id": "ed4674e3", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0011d366", + "id": "38f24911", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "922af7db", + "id": "a2e1e409", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "145554fa", + "id": "d65d773b", "metadata": {}, "source": [ "## Mapping flood extents\n", @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e33df7e", + "id": "443bd51b", "metadata": {}, "outputs": [], "source": [ @@ -311,7 +311,7 @@ }, { "cell_type": "markdown", - "id": "43833897", + "id": "9c0c76c5", "metadata": {}, "source": [ "### Search datasets" @@ -320,7 +320,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92b4c221", + "id": "427ebf00", "metadata": {}, "outputs": [], "source": [ @@ -333,7 +333,7 @@ }, { "cell_type": "markdown", - "id": "80bafdec", + "id": "bb4b8e6d", "metadata": {}, "source": [ "### Visualize datasets" @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "875c4160", + "id": "7278348d", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +357,7 @@ }, { "cell_type": "markdown", - "id": "a5515bf8", + "id": "316c49fe", "metadata": {}, "source": [ "### Create Landsat composites" @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdafd1a2", + "id": "4a1a07bc", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d714b2bb", + "id": "658d952d", "metadata": {}, "outputs": [], "source": [ @@ -404,7 +404,7 @@ }, { "cell_type": "markdown", - "id": "40ad5e7a", + "id": "74faee00", "metadata": {}, "source": [ "### Compare Landsat composites side by side" @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80b9e6a0", + "id": "9403f210", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "062195bf", + "id": "875c23d9", "metadata": {}, "source": [ "### Compute Normalized Difference Water Index (NDWI)" @@ -445,7 +445,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41742d7e", + "id": "77912b44", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d016ec7c", + "id": "f710245c", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ }, { "cell_type": "markdown", - "id": "2783f2b0", + "id": "58eac3cc", "metadata": {}, "source": [ "### Extract Landsat water extent" @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecb407b2", + "id": "6ed07773", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cf69eb90", + "id": "2e18573e", "metadata": {}, "outputs": [], "source": [ @@ -521,7 +521,7 @@ }, { "cell_type": "markdown", - "id": "7a04ede0", + "id": "847b8bc7", "metadata": {}, "source": [ "### Extract Landsat flood extent" @@ -530,7 +530,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02416af8", + "id": "473e7f30", "metadata": {}, "outputs": [], "source": [ @@ -540,7 +540,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89c50f78", + "id": "494053f1", "metadata": {}, "outputs": [], "source": [ @@ -568,7 +568,7 @@ }, { "cell_type": "markdown", - "id": "a142112a", + "id": "1d786569", "metadata": {}, "source": [ "### Calculate Landsat flood area" @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c94c2566", + "id": "534156f7", "metadata": {}, "outputs": [], "source": [ @@ -590,7 +590,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7146c68", + "id": "0b233296", "metadata": {}, "outputs": [], "source": [ @@ -603,7 +603,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db02b816", + "id": "55ae0cb9", "metadata": {}, "outputs": [], "source": [ @@ -615,7 +615,7 @@ }, { "cell_type": "markdown", - "id": "fe9bb1ca", + "id": "59f1eea5", "metadata": {}, "source": [ "### Create Sentinel-1 SAR composites" @@ -624,7 +624,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f612bf1", + "id": "0ab9f11b", "metadata": {}, "outputs": [], "source": [ @@ -643,7 +643,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d081eb60", + "id": "e314cc54", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +662,7 @@ { "cell_type": "code", "execution_count": null, - "id": "721eedae", + "id": "15f47dbc", "metadata": {}, "outputs": [], "source": [ @@ -678,7 +678,7 @@ }, { "cell_type": "markdown", - "id": "4044483c", + "id": "57fb4a1f", "metadata": {}, "source": [ "### Apply speckle filtering" @@ -687,7 +687,7 @@ { "cell_type": "code", "execution_count": null, - "id": "275fba6e", + "id": "6a9be26e", "metadata": {}, "outputs": [], "source": [ @@ -706,7 +706,7 @@ }, { "cell_type": "markdown", - "id": "8326d047", + "id": "f5e115b2", "metadata": {}, "source": [ "### Compare Sentinel-1 SAR composites side by side" @@ -715,7 +715,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec10eac0", + "id": "b9260b23", "metadata": {}, "outputs": [], "source": [ @@ -734,7 +734,7 @@ }, { "cell_type": "markdown", - "id": "0a0d04c3", + "id": "0a0c274e", "metadata": {}, "source": [ "### Extract SAR water extent" @@ -743,7 +743,7 @@ { "cell_type": "code", "execution_count": null, - "id": "983a4d70", + "id": "43423361", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0b35b3b", + "id": "0ef5da5d", "metadata": {}, "outputs": [], "source": [ @@ -781,7 +781,7 @@ }, { "cell_type": "markdown", - "id": "56f5d791", + "id": "ad95b802", "metadata": {}, "source": [ "### Extract SAR flood extent" @@ -790,7 +790,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbca1be9", + "id": "b9ce185f", "metadata": {}, "outputs": [], "source": [ @@ -800,7 +800,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4fc85199", + "id": "9515ebed", "metadata": {}, "outputs": [], "source": [ @@ -828,7 +828,7 @@ }, { "cell_type": "markdown", - "id": "1a858356", + "id": "34347f84", "metadata": {}, "source": [ "### Calculate SAR flood area" @@ -837,7 +837,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9417606f", + "id": "6cd7537a", "metadata": {}, "outputs": [], "source": [ @@ -850,7 +850,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ebd22eb", + "id": "35560aef", "metadata": {}, "outputs": [], "source": [ @@ -863,7 +863,7 @@ { "cell_type": "code", "execution_count": null, - "id": "007f38fd", + "id": "620b37d4", "metadata": {}, "outputs": [], "source": [ @@ -875,7 +875,7 @@ }, { "cell_type": "markdown", - "id": "05747612", + "id": "c47516e7", "metadata": {}, "source": [ "## Forest cover change analysis\n", @@ -886,7 +886,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d21edb3a", + "id": "93bd91b9", "metadata": {}, "outputs": [], "source": [ @@ -897,7 +897,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e39391d", + "id": "5dc495c3", "metadata": {}, "outputs": [], "source": [ @@ -910,7 +910,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57a9e0cb", + "id": "34dc5e8c", "metadata": {}, "outputs": [], "source": [ @@ -922,7 +922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf677366", + "id": "75c0e44f", "metadata": {}, "outputs": [], "source": [ @@ -937,7 +937,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56e343e6", + "id": "3777b0dc", "metadata": {}, "outputs": [], "source": [ @@ -949,7 +949,7 @@ }, { "cell_type": "markdown", - "id": "b236260d", + "id": "7e581038", "metadata": {}, "source": [ "### Forest loss and gain mapping" @@ -958,7 +958,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e39c1f9d", + "id": "0bcd734c", "metadata": {}, "outputs": [], "source": [ @@ -974,7 +974,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f081c43", + "id": "fa9838c2", "metadata": {}, "outputs": [], "source": [ @@ -987,7 +987,7 @@ }, { "cell_type": "markdown", - "id": "10c032e0", + "id": "f58bf92a", "metadata": {}, "source": [ "### Zonal statistics by country" @@ -996,7 +996,7 @@ { "cell_type": "code", "execution_count": null, - "id": "415a8986", + "id": "82d1d61a", "metadata": {}, "outputs": [], "source": [ @@ -1010,7 +1010,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b0bec33", + "id": "826a0cd8", "metadata": {}, "outputs": [], "source": [ @@ -1027,7 +1027,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56185f8c", + "id": "389e12c2", "metadata": {}, "outputs": [], "source": [ @@ -1039,7 +1039,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2db32b7d", + "id": "01d09aab", "metadata": {}, "outputs": [], "source": [ @@ -1056,7 +1056,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80c20e5a", + "id": "cbc5ae07", "metadata": {}, "outputs": [], "source": [ @@ -1073,7 +1073,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e543dc84", + "id": "92329db8", "metadata": {}, "outputs": [], "source": [ @@ -1085,7 +1085,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01f328c7", + "id": "21bb1a73", "metadata": {}, "outputs": [], "source": [ @@ -1101,7 +1101,7 @@ }, { "cell_type": "markdown", - "id": "57a290dd", + "id": "befc1d99", "metadata": {}, "source": [ "## Global land cover mapping\n", @@ -1112,7 +1112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38e9bdd3", + "id": "9e925d4d", "metadata": {}, "outputs": [], "source": [ @@ -1142,7 +1142,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1e7a2cb", + "id": "11f5c9cf", "metadata": {}, "outputs": [], "source": [ @@ -1170,7 +1170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce7b4b62", + "id": "2a23c282", "metadata": {}, "outputs": [], "source": [ @@ -1183,7 +1183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02c33f38", + "id": "4fdc3e70", "metadata": {}, "outputs": [], "source": [ @@ -1196,7 +1196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6a9e591", + "id": "518749e6", "metadata": {}, "outputs": [], "source": [ @@ -1207,7 +1207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e42e20db", + "id": "76bd241f", "metadata": {}, "outputs": [], "source": [ @@ -1226,7 +1226,7 @@ }, { "cell_type": "markdown", - "id": "4cf107bc", + "id": "f24ef63b", "metadata": {}, "source": [ "### ESA WorldCover" @@ -1235,7 +1235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c13d688", + "id": "a77af039", "metadata": {}, "outputs": [], "source": [ @@ -1251,7 +1251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83215ccf", + "id": "b43ee467", "metadata": {}, "outputs": [], "source": [ @@ -1264,7 +1264,7 @@ { "cell_type": "code", "execution_count": null, - "id": "265483be", + "id": "7aea5bac", "metadata": {}, "outputs": [], "source": [ @@ -1274,7 +1274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f6050a7f", + "id": "2b0f9564", "metadata": {}, "outputs": [], "source": [ @@ -1304,7 +1304,7 @@ }, { "cell_type": "markdown", - "id": "22e123af", + "id": "987ef8af", "metadata": {}, "source": [ "### Esri global land cover" @@ -1313,7 +1313,7 @@ { "cell_type": "code", "execution_count": null, - "id": "930bfefc", + "id": "7bf11782", "metadata": {}, "outputs": [], "source": [ @@ -1328,7 +1328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60545eb3", + "id": "d0717fdc", "metadata": {}, "outputs": [], "source": [ @@ -1342,7 +1342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29df8fcf", + "id": "b1a9300a", "metadata": {}, "outputs": [], "source": [ @@ -1365,7 +1365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d28576e0", + "id": "805cdc27", "metadata": {}, "outputs": [], "source": [ @@ -1378,7 +1378,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0176e52", + "id": "ca32cead", "metadata": {}, "outputs": [], "source": [ @@ -1405,7 +1405,7 @@ }, { "cell_type": "markdown", - "id": "3330bc07", + "id": "ba0f76e8", "metadata": {}, "source": [ "## Concluding remarks" diff --git a/_sources/book/labs/README.ipynb b/_sources/book/labs/README.ipynb index 865ea85..b585eb1 100644 --- a/_sources/book/labs/README.ipynb +++ b/_sources/book/labs/README.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7b7779eb", + "id": "1bd6d3f2", "metadata": {}, "source": [ "# Submission Instructions\n", diff --git a/_sources/book/labs/lab_01.ipynb b/_sources/book/labs/lab_01.ipynb index b17050c..aac98f7 100644 --- a/_sources/book/labs/lab_01.ipynb +++ b/_sources/book/labs/lab_01.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "2fb398ac", + "id": "61336c91", "metadata": {}, "source": [ "# Lab 1\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b787e857", + "id": "842d69b5", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "91c319b9", + "id": "334e068f", "metadata": {}, "source": [ "![](https://i.imgur.com/ZfZCdhL.png)" diff --git a/_sources/book/labs/lab_02.ipynb b/_sources/book/labs/lab_02.ipynb index 28e08fd..01b3dab 100644 --- a/_sources/book/labs/lab_02.ipynb +++ b/_sources/book/labs/lab_02.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e3b4abf4", + "id": "0e8b9a2a", "metadata": {}, "source": [ "# Lab 2\n", @@ -15,7 +15,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98c560ca", + "id": "c3a713cf", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "markdown", - "id": "c2abc839", + "id": "9e57b33b", "metadata": {}, "source": [ "![](https://i.imgur.com/ClnsQPY.png)" diff --git a/_sources/book/labs/lab_03.ipynb b/_sources/book/labs/lab_03.ipynb index 1de610e..fcb71bc 100644 --- a/_sources/book/labs/lab_03.ipynb +++ b/_sources/book/labs/lab_03.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "340f20ec", + "id": "927d75a2", "metadata": {}, "source": [ "# Lab 3\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc2044a7", + "id": "28a7f3d5", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "8008ad9e", + "id": "910bd17c", "metadata": {}, "source": [ "## Readings\n", @@ -40,7 +40,7 @@ }, { "cell_type": "markdown", - "id": "f8f5b30e", + "id": "03a98075", "metadata": {}, "source": [ "## Question 1\n", @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbd7339c", + "id": "24b114a6", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +62,7 @@ { "cell_type": "code", "execution_count": null, - "id": "172c653e", + "id": "19441db5", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "8dcb9be0", + "id": "3f3b0816", "metadata": {}, "source": [ "![](https://i.imgur.com/RhUy93b.png)" @@ -79,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "e854c30e", + "id": "d549251b", "metadata": {}, "source": [ "## Question 2\n", @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3d88d1e", + "id": "fdb0538f", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "bae286b6", + "id": "f997a7c1", "metadata": {}, "source": [ "![](https://i.imgur.com/xkxpkS1.png)" diff --git a/_sources/book/labs/lab_04.ipynb b/_sources/book/labs/lab_04.ipynb index 5df5238..2521225 100644 --- a/_sources/book/labs/lab_04.ipynb +++ b/_sources/book/labs/lab_04.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "675eecfa", + "id": "26a70495", "metadata": {}, "source": [ "# Lab 4\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f09255b7", + "id": "a5df0a2a", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8474cf43", + "id": "23981b61", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "aab6e011", + "id": "f39dd2d3", "metadata": {}, "source": [ "## Datasets\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "8a674614", + "id": "dcf95c94", "metadata": {}, "source": [ "## Question 1\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4aa022f6", + "id": "665753d8", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "6fb24c9f", + "id": "252105e8", "metadata": {}, "source": [ "![](https://i.imgur.com/3Jg9P6X.png)" @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "2ce31f5f", + "id": "70723d0b", "metadata": {}, "source": [ "## Question 2\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36544500", + "id": "1eb6927b", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "984c36af", + "id": "97a49287", "metadata": {}, "source": [ "![](https://i.imgur.com/28Iaw9b.png)" @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "c12f59a7", + "id": "0b9e98ca", "metadata": {}, "source": [ "## Question 3\n", @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8dd3fb8", + "id": "b1ec20ed", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "fd6dea58", + "id": "563bd2ab", "metadata": {}, "source": [ "![](https://i.imgur.com/m72amN0.png)" @@ -136,7 +136,7 @@ }, { "cell_type": "markdown", - "id": "6a0e9605", + "id": "f5fa6f39", "metadata": {}, "source": [ "## Question 4\n", @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5c79fb4", + "id": "546c6d57", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "af168234", + "id": "450c0dec", "metadata": {}, "source": [ "![](https://i.imgur.com/vM1M8Gc.png)" @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "b8457d36", + "id": "1db6e05a", "metadata": {}, "source": [ "## Question 5\n", @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a085ba1d", + "id": "7e3327bb", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "9faa2764", + "id": "ac974481", "metadata": {}, "source": [ "![](https://i.imgur.com/iZSGqGS.png)" diff --git a/_sources/book/labs/lab_05.ipynb b/_sources/book/labs/lab_05.ipynb index 9e810a3..5621ad3 100644 --- a/_sources/book/labs/lab_05.ipynb +++ b/_sources/book/labs/lab_05.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cf11620b", + "id": "284dd5b6", "metadata": {}, "source": [ "# Lab 5\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e1321a3", + "id": "08bde045", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "74ffd058", + "id": "e3a3570a", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "85fe5da9", + "id": "586f80f9", "metadata": {}, "source": [ "## Question 1\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac948807", + "id": "957af671", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "f39d2d4c", + "id": "6379f349", "metadata": {}, "source": [ "![](https://i.imgur.com/PLlNFq3.png)" @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "87e75d31", + "id": "15a96c12", "metadata": {}, "source": [ "## Question 2 \n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96b48582", + "id": "3c527d64", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "fb45df5a", + "id": "8f5db4ae", "metadata": {}, "source": [ "![](https://i.imgur.com/F2QfqZu.png)" @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "fd6624c1", + "id": "3df01733", "metadata": {}, "source": [ "## Question 3\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29e66031", + "id": "37e1e66c", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "936126d8", + "id": "89747cfc", "metadata": {}, "source": [ "![](https://i.imgur.com/okR39pf.png)" @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "7cbaf13f", + "id": "fa8b4b0c", "metadata": {}, "source": [ "## Question 4\n", @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abeaee2e", + "id": "8fe69f17", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "7a8d1e8a", + "id": "2d3e180e", "metadata": {}, "source": [ "![](https://i.imgur.com/Au7Q5Ln.png)" @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "f423b117", + "id": "fcc088d6", "metadata": {}, "source": [ "## Questions 5\n", @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59023d70", + "id": "7179ab3c", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "146f474e", + "id": "b454f9e4", "metadata": {}, "source": [ "![](https://i.imgur.com/AUlO1CV.png)" diff --git a/_sources/book/labs/lab_06.ipynb b/_sources/book/labs/lab_06.ipynb index f8642c1..ccbcab1 100644 --- a/_sources/book/labs/lab_06.ipynb +++ b/_sources/book/labs/lab_06.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "fb144a7c", + "id": "e258c016", "metadata": {}, "source": [ "# Lab 6\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c475db1", + "id": "de262174", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b9f3b263", + "id": "a72ed47c", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "e85fb72e", + "id": "0a70d1ca", "metadata": {}, "source": [ "## Question 1\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a84230ee", + "id": "62926246", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "fd711e11", + "id": "b7450eed", "metadata": {}, "source": [ "![](https://i.imgur.com/bBoRswR.png)" @@ -65,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "98adcbde", + "id": "680d91d8", "metadata": {}, "source": [ "## Question 2\n", @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64da2309", + "id": "841ffb45", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "b828ea73", + "id": "7041c685", "metadata": {}, "source": [ "![](https://i.imgur.com/Xp15uOo.png)" @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "18d7f2e6", + "id": "8bb83a7d", "metadata": {}, "source": [ "## Question 3\n", @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31154020", + "id": "99d494e1", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "18b677bc", + "id": "ebfb5bad", "metadata": {}, "source": [ "![](https://i.imgur.com/gW1XPhL.png)" @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "f94b3bfc", + "id": "19c3b9f9", "metadata": {}, "source": [ "## Question 4\n", @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ae3ccba", + "id": "c8950828", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "7162739a", + "id": "1cb3a1e4", "metadata": {}, "source": [ "![](https://i.imgur.com/rJe2rvP.png)" @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "937e843a", + "id": "4fd7638e", "metadata": {}, "source": [ "## Question 5\n", @@ -163,7 +163,7 @@ }, { "cell_type": "markdown", - "id": "feaafe47", + "id": "551d71ed", "metadata": {}, "source": [ "Currently, the split-map control of ipyleaflet plotting backend has a bug ([source](https://github.com/jupyter-widgets/ipyleaflet/issues/1066)). Use the folium plotting backend instead." @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abaf9ede", + "id": "bef6ca5e", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "62c499b1", + "id": "332ae1c4", "metadata": {}, "source": [ "![](https://i.imgur.com/y0GW6k8.png)" diff --git a/_sources/book/labs/lab_07.ipynb b/_sources/book/labs/lab_07.ipynb index 199c66d..bef3279 100644 --- a/_sources/book/labs/lab_07.ipynb +++ b/_sources/book/labs/lab_07.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "35b816ac", + "id": "a09607c3", "metadata": {}, "source": [ "# Lab 7\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f63d6478", + "id": "73f88e88", "metadata": {}, "outputs": [], "source": [ @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6dec1e89", + "id": "6e12a664", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +37,7 @@ }, { "cell_type": "markdown", - "id": "fe1ee4cc", + "id": "1ef769ec", "metadata": {}, "source": [ "## Datasets\n", @@ -52,7 +52,7 @@ }, { "cell_type": "markdown", - "id": "910c7c67", + "id": "66295e2a", "metadata": {}, "source": [ "## Question 1\n", @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37c2cba4", + "id": "8b955383", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "38ab6ed0", + "id": "a4ca12b4", "metadata": {}, "source": [ "## Question 2\n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7202c3c3", + "id": "27fbc128", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "3e793bfc", + "id": "26a332f0", "metadata": {}, "source": [ "## Question 3\n", @@ -111,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a93d271d", + "id": "0e854ec2", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "b3c9c686", + "id": "462c9024", "metadata": {}, "source": [ "## Question 4\n", @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e4ae28b", + "id": "3e0b2992", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "6366371e", + "id": "9240b17c", "metadata": {}, "source": [ "## Question 5\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f410be7", + "id": "4ab53a70", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/postgis/geometries.ipynb b/_sources/book/postgis/geometries.ipynb index 2954584..6b10476 100644 --- a/_sources/book/postgis/geometries.ipynb +++ b/_sources/book/postgis/geometries.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ddd8495d", + "id": "b62f0d43", "metadata": {}, "source": [ "# Working with Geometries\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "a2877202", + "id": "7f96ff5f", "metadata": {}, "source": [ "## Connecting to the database" @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dac99a5", + "id": "b18273c9", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6560ee4", + "id": "84153507", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3fbde7d", + "id": "07eb6695", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "947d1ffa", + "id": "35595424", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9102a826", + "id": "82f170ee", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ccae0ac", + "id": "e2cbf0cf", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "a0a10599", + "id": "cf0a7693", "metadata": {}, "source": [ "## Creating geometries" @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c784edd7", + "id": "c2521b96", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "8da55a26", + "id": "68c3053c", "metadata": {}, "source": [ "## Metadata tables" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75def572", + "id": "945e1913", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "391a4543", + "id": "f08da314", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "81ee4bc8", + "id": "8a1a2221", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "e64db92a", + "id": "ef07b1c8", "metadata": {}, "source": [ "## Points\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e42ddef", + "id": "76c76de0", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "4d9621ce", + "id": "226b2e8c", "metadata": {}, "source": [ "Some of the specific spatial functions for working with points are:\n", @@ -212,7 +212,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3347a193", + "id": "55b2f9ec", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +226,7 @@ { "cell_type": "code", "execution_count": null, - "id": "79c63a18", + "id": "1245b7fe", "metadata": {}, "outputs": [], "source": [ @@ -239,7 +239,7 @@ }, { "cell_type": "markdown", - "id": "5ee617c3", + "id": "9203fcb9", "metadata": {}, "source": [ "## Linestrings\n", @@ -266,7 +266,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17158af5", + "id": "2c8cbf5c", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ }, { "cell_type": "markdown", - "id": "8bf79476", + "id": "dd2f2526", "metadata": {}, "source": [ "Some of the specific spatial functions for working with linestrings are:\n", @@ -296,7 +296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "524cba61", + "id": "2e6dce50", "metadata": {}, "outputs": [], "source": [ @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "3488e7df", + "id": "c9ab0df0", "metadata": {}, "source": [ "## Polygons" @@ -317,7 +317,7 @@ }, { "cell_type": "markdown", - "id": "6bc5039a", + "id": "879e5610", "metadata": {}, "source": [ "![](https://postgis.net/workshops/postgis-intro/_images/polygons.png)\n", @@ -340,7 +340,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77a19e30", + "id": "83d9f9a1", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "55e2becf", + "id": "85b6f05d", "metadata": {}, "source": [ "Some of the specific spatial functions for working with polygons are:\n", @@ -372,7 +372,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6d9309ad", + "id": "e05bf9b6", "metadata": {}, "outputs": [], "source": [ @@ -385,7 +385,7 @@ }, { "cell_type": "markdown", - "id": "910f26d8", + "id": "797ed1fd", "metadata": {}, "source": [ "## Collections\n", @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "660dc53a", + "id": "22c15ba6", "metadata": {}, "outputs": [], "source": [ @@ -424,7 +424,7 @@ }, { "cell_type": "markdown", - "id": "de72f439", + "id": "882fd4eb", "metadata": {}, "source": [ "Some of the specific spatial functions for working with collections are:\n", @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "7afd2343", + "id": "2351f752", "metadata": {}, "source": [ "## Geometry Input and Output\n", @@ -476,7 +476,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da010a93", + "id": "f8810970", "metadata": {}, "outputs": [], "source": [ @@ -500,7 +500,7 @@ }, { "cell_type": "markdown", - "id": "ed8c67a4", + "id": "2685e17b", "metadata": {}, "source": [ "## Casting from Text\n", @@ -518,7 +518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b2eb1a7", + "id": "296a87ce", "metadata": {}, "outputs": [], "source": [ @@ -529,7 +529,7 @@ }, { "cell_type": "markdown", - "id": "6f9c0e21", + "id": "91823f3c", "metadata": {}, "source": [ "Less trivially, this SQL converts a WKT string into a geometry:" @@ -538,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d720163", + "id": "35b30236", "metadata": {}, "outputs": [], "source": [ @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "3b304eb6", + "id": "a3200fb0", "metadata": {}, "source": [ "One thing to note about using casting to create geometries: unless you specify the SRID, you will get a geometry with an unknown SRID. You can specify the SRID using the “extended” well-known text form, which includes an SRID block at the front:" @@ -558,7 +558,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e949ff5e", + "id": "af1f46b6", "metadata": {}, "outputs": [], "source": [ @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "615af2ef", + "id": "cf5cc8a5", "metadata": {}, "source": [ "## Function List\n", diff --git a/_sources/book/postgis/geopandas.ipynb b/_sources/book/postgis/geopandas.ipynb index 8a00127..93a66b8 100644 --- a/_sources/book/postgis/geopandas.ipynb +++ b/_sources/book/postgis/geopandas.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f9c47203", + "id": "7e0463de", "metadata": {}, "source": [ "# Using GeoPandas\n", @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "325f54dc", + "id": "9b873d9a", "metadata": {}, "source": [ "## Connecting to the database" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51312e9a", + "id": "1cd6942d", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ce0e580", + "id": "0b8210c5", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b818207", + "id": "e68b4173", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": null, - "id": "061a1b6f", + "id": "bc750d69", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4b00264", + "id": "bc79a112", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36afda19", + "id": "3033d266", "metadata": {}, "outputs": [], "source": [ @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "aa9aafa8", + "id": "da37a650", "metadata": {}, "source": [ "## Reading data from PostGIS" @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c7fad580", + "id": "ada52ea5", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6779bc28", + "id": "9cd2c51f", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5b9a42e", + "id": "35f5dd23", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c37086fe", + "id": "c3d52054", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5404da10", + "id": "952439c5", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "acecd9ef", + "id": "9d454e19", "metadata": {}, "source": [ "## Writing files" @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a373cc97", + "id": "bccb0688", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33497843", + "id": "a48ed856", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5bab067", + "id": "589dec2e", "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fcd6c457", + "id": "b8fef8c3", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "97868353", + "id": "636f95e1", "metadata": {}, "source": [ "## Measuring area" @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcdf933b", + "id": "fbb797df", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86b85367", + "id": "b4601b59", "metadata": {}, "outputs": [], "source": [ @@ -239,7 +239,7 @@ }, { "cell_type": "markdown", - "id": "fcea07b5", + "id": "fc6707b4", "metadata": {}, "source": [ "## Getting polygon bounary" @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "08b0197d", + "id": "e5da3454", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ }, { "cell_type": "markdown", - "id": "1be83f04", + "id": "6ff60a2e", "metadata": {}, "source": [ "## Getting polygon centroid" @@ -267,7 +267,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e438966", + "id": "21d8d654", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "ceed81bd", + "id": "8b6efd5a", "metadata": {}, "source": [ "## Making maps" @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c927165f", + "id": "25584408", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a9f5ecb", + "id": "bff3c482", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6491f93d", + "id": "d803246f", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "880d0d2d", + "id": "a727c001", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5743e8eb", + "id": "b825c638", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "0fb3c61c", + "id": "208c3a9b", "metadata": {}, "source": [ "## Reprojecting data" @@ -346,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e924891c", + "id": "2c5ba511", "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f5e2355", + "id": "42c2619c", "metadata": {}, "outputs": [], "source": [ @@ -366,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e614a0c", + "id": "3c11ac2d", "metadata": {}, "outputs": [], "source": [ @@ -376,7 +376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70b20444", + "id": "84acb458", "metadata": {}, "outputs": [], "source": [ @@ -386,7 +386,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88b9ecda", + "id": "07190493", "metadata": {}, "outputs": [], "source": [ @@ -395,7 +395,7 @@ }, { "cell_type": "markdown", - "id": "4a44b835", + "id": "61708690", "metadata": {}, "source": [ "## Displaying data on an interative map" @@ -404,7 +404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56b5eee3", + "id": "700a614a", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dc5a4bef", + "id": "42d66180", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da3437fb", + "id": "04153214", "metadata": {}, "outputs": [], "source": [ @@ -443,7 +443,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10ba6158", + "id": "35d3e1af", "metadata": {}, "outputs": [], "source": [ @@ -453,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18b5f23f", + "id": "fd7c5eae", "metadata": {}, "outputs": [], "source": [ @@ -463,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af46e537", + "id": "1c82c4e6", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e0a6d5c", + "id": "a32dc109", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f93d286", + "id": "1d8799b9", "metadata": {}, "outputs": [], "source": [ @@ -493,7 +493,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad88147b", + "id": "f7b495f7", "metadata": {}, "outputs": [], "source": [ @@ -503,7 +503,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4eb9efa", + "id": "aa5eea70", "metadata": {}, "outputs": [], "source": [ @@ -513,7 +513,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3f71e1c", + "id": "4c9121d5", "metadata": {}, "outputs": [], "source": [ @@ -523,7 +523,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17626fc0", + "id": "180ec60b", "metadata": {}, "outputs": [], "source": [ @@ -533,7 +533,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a0e3e5e", + "id": "384b8531", "metadata": {}, "outputs": [], "source": [ @@ -543,7 +543,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1ef43f6", + "id": "c05fb8ef", "metadata": {}, "outputs": [], "source": [ @@ -553,7 +553,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38d669e0", + "id": "2fb5fb89", "metadata": {}, "outputs": [], "source": [ @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0233691", + "id": "e6a21786", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +573,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54679c88", + "id": "4d5045a0", "metadata": {}, "outputs": [], "source": [ @@ -583,7 +583,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c58a7965", + "id": "5b3a3798", "metadata": {}, "outputs": [], "source": [ @@ -593,7 +593,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b23812df", + "id": "e2183fb4", "metadata": {}, "outputs": [], "source": [ @@ -603,7 +603,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8947fcfd", + "id": "8abea2d2", "metadata": {}, "outputs": [], "source": [] diff --git a/_sources/book/postgis/installation.ipynb b/_sources/book/postgis/installation.ipynb index 2f0881c..77df912 100644 --- a/_sources/book/postgis/installation.ipynb +++ b/_sources/book/postgis/installation.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f8648483", + "id": "d4e48fd2", "metadata": {}, "source": [ "# Installation\n", @@ -21,7 +21,7 @@ }, { "cell_type": "markdown", - "id": "eb8466b9", + "id": "da742dc6", "metadata": {}, "source": [ "## Using ipython-sql" @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "54a8775c", + "id": "de70d0ff", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +40,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6399cd1d", + "id": "45e43e7e", "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e13f63f", + "id": "499c9692", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4ffc8ab", + "id": "cdf37dae", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6aed9121", + "id": "b2b45a01", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e68e391b", + "id": "852f8f94", "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe469b81", + "id": "bb02384c", "metadata": { "tags": [ "remove-output" @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "bc3a62de", + "id": "cf8b6f4a", "metadata": {}, "source": [ "## Using sqlalchemy" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a1ea54c1", + "id": "c5441605", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c63dff73", + "id": "69fe1a5f", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98597fb5", + "id": "34799994", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d832a2e", + "id": "3a6c29cd", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f02837d", + "id": "d01d268d", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b1f6b07", + "id": "fb570634", "metadata": {}, "outputs": [], "source": [ @@ -180,7 +180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbbe66b8", + "id": "cef03473", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b9082da", + "id": "645e8d4a", "metadata": {}, "outputs": [], "source": [] diff --git a/_sources/book/postgis/postgis_intro.ipynb b/_sources/book/postgis/postgis_intro.ipynb index 5f6c000..b0baab2 100644 --- a/_sources/book/postgis/postgis_intro.ipynb +++ b/_sources/book/postgis/postgis_intro.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b178af81", + "id": "9f008810", "metadata": {}, "source": [ "# Introduction to PostGIS\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "aaa44c53", + "id": "41acbae5", "metadata": {}, "source": [ "## Connecting to the database" @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc67844b", + "id": "47f14a6b", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d75df8b", + "id": "2e67315d", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6d31f0a", + "id": "83dd2598", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdf1a01c", + "id": "d6910a9e", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "150db68d", + "id": "5f4ab6cd", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "67a137e8", + "id": "028f3319", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "857b9359", + "id": "eb2c5eb3", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "867ebdcb", + "id": "f4832579", "metadata": {}, "source": [ "## Simple SQL" @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7223684", + "id": "21729d04", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "61822914", + "id": "4417f85a", "metadata": {}, "source": [ "### NYC Neighborhoods\n", @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "32c8dc8c", + "id": "72f391da", "metadata": {}, "source": [ "What are the names of all the neighborhoods in New York City?" @@ -149,7 +149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f38e6fcf", + "id": "408963f1", "metadata": { "tags": [ "hide-output" @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "d8f64a18", + "id": "317cd6fd", "metadata": {}, "source": [ "What are the names of all the neighborhoods in Brooklyn?" @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dffcce37", + "id": "71271c9d", "metadata": { "tags": [ "hide-output" @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "f514772b", + "id": "1dd23bbf", "metadata": {}, "source": [ "What is the number of letters in the names of all the neighborhoods in Brooklyn?" @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a49cc4ed", + "id": "d4a7424a", "metadata": { "tags": [ "hide-output" @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "1d3c6bda", + "id": "8f546568", "metadata": {}, "source": [ "What is the average number of letters and standard deviation of number of letters in the names of all the neighborhoods in Brooklyn?" @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d92ba5aa", + "id": "5416a334", "metadata": {}, "outputs": [], "source": [ @@ -238,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "f6ef2c92", + "id": "98affe53", "metadata": {}, "source": [ "What is the average number of letters in the names of all the neighborhoods in New York City, reported by borough?" @@ -247,7 +247,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a70eff9", + "id": "798efea6", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "416e6277", + "id": "e265255a", "metadata": {}, "source": [ "### NYC Census Blocks\n", @@ -271,7 +271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60c05c24", + "id": "92da114e", "metadata": {}, "outputs": [], "source": [ @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "3c5593b5", + "id": "05c71252", "metadata": {}, "source": [ "What is the population of the City of New York?" @@ -291,7 +291,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e67e259b", + "id": "39a709e4", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "144b1ec4", + "id": "29622733", "metadata": {}, "source": [ "What is the population of the Bronx?" @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d3717235", + "id": "e05ae734", "metadata": {}, "outputs": [], "source": [ @@ -325,7 +325,7 @@ }, { "cell_type": "markdown", - "id": "8b6df2f1", + "id": "6bb2595e", "metadata": {}, "source": [ "For each borough, what percentage of the population is white?" @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d1cb967", + "id": "9ca09966", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/postgis/projection.ipynb b/_sources/book/postgis/projection.ipynb index ed287d6..dcb0eea 100644 --- a/_sources/book/postgis/projection.ipynb +++ b/_sources/book/postgis/projection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b5f1a041", + "id": "af1a5a42", "metadata": {}, "source": [ "# Projecting Data\n", @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "47aa10f3", + "id": "cafd1af5", "metadata": {}, "source": [ "## Connecting to the database" @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01190a10", + "id": "386b1981", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7ee3d89", + "id": "28db2119", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37861118", + "id": "bba21048", "metadata": {}, "outputs": [], "source": [ @@ -67,7 +67,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ad4ea35", + "id": "d9b5e007", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9f08c677", + "id": "c2364d75", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b63270af", + "id": "654cbcca", "metadata": {}, "outputs": [], "source": [ @@ -98,7 +98,7 @@ }, { "cell_type": "markdown", - "id": "e3eb0dea", + "id": "71038ecb", "metadata": {}, "source": [ "## Checking SRID\n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd7fb16a", + "id": "ad1fbb6a", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "c7711971", + "id": "125a9e78", "metadata": {}, "source": [ "And what is definition of \\\"26918\\\"? As we saw in\n", @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5443912", + "id": "a6ec54e8", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "e12d47f5", + "id": "4b81e634", "metadata": {}, "source": [ "In fact, for the internal PostGIS re-projection calculations, it is the\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ff8dbdf", + "id": "06b55da2", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "7caa782d", + "id": "77f27677", "metadata": {}, "source": [ "In practice, both the `srtext` and the `proj4text` columns are\n", @@ -200,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "b4f98c3e", + "id": "87b9c816", "metadata": {}, "source": [ "## Comparing Data\n", @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "962f51b1", + "id": "f88128c0", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ }, { "cell_type": "markdown", - "id": "45df7fdc", + "id": "5130bed6", "metadata": {}, "source": [ "Be careful of getting too happy with using\n", @@ -247,7 +247,7 @@ }, { "cell_type": "markdown", - "id": "95cbd837", + "id": "60bf3d02", "metadata": {}, "source": [ "## Transforming Data\n", @@ -278,7 +278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29e9ddc4", + "id": "60eeb593", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +289,7 @@ }, { "cell_type": "markdown", - "id": "4e5102d5", + "id": "01407695", "metadata": {}, "source": [ "Let\\'s convert the coordinates of the \\'Broad St\\' subway station into\n", @@ -299,7 +299,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34a52e2a", + "id": "5cc90a4c", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c6710a6", + "id": "ff2b1137", "metadata": {}, "outputs": [], "source": [ @@ -326,7 +326,7 @@ }, { "cell_type": "markdown", - "id": "1821de0b", + "id": "77d38cd9", "metadata": {}, "source": [ "If you load data or create a new geometry without specifying an SRID,\n", @@ -342,7 +342,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff4f10f5", + "id": "d5cc0fdd", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "740ca62d", + "id": "b16c6b42", "metadata": {}, "source": [ "However, if you know what the SRID of the coordinates is supposed to be,\n", @@ -365,7 +365,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94823d2a", + "id": "e11dd21b", "metadata": {}, "outputs": [], "source": [ @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "5f7818ff", + "id": "26d355b6", "metadata": {}, "source": [ "## Function List\n", diff --git a/_sources/book/postgis/spatial_relationships.ipynb b/_sources/book/postgis/spatial_relationships.ipynb index 63f98f8..9138852 100644 --- a/_sources/book/postgis/spatial_relationships.ipynb +++ b/_sources/book/postgis/spatial_relationships.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "e68b81e5", + "id": "ccaba5eb", "metadata": {}, "source": [ "# Spatial Relationships\n", @@ -26,7 +26,7 @@ }, { "cell_type": "markdown", - "id": "264d39ab", + "id": "ebc8fb16", "metadata": {}, "source": [ "## Connecting to the database" @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dbe2192b", + "id": "219b4ab4", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a1b88b4", + "id": "eccb5957", "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b0aa359", + "id": "f38aaa3d", "metadata": {}, "outputs": [], "source": [ @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d1c66a9", + "id": "2c43869f", "metadata": {}, "outputs": [], "source": [ @@ -78,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed447b85", + "id": "b72dce3b", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +88,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4ba4d34", + "id": "ea89f9cb", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "2dcf13f9", + "id": "d30015e1", "metadata": {}, "source": [ "## Spatial Relationships\n", @@ -124,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "6878700c", + "id": "6d6ab906", "metadata": {}, "source": [ "## ST_Equals\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5abb569", + "id": "83800806", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "d1485d0e", + "id": "b4d2b0d9", "metadata": {}, "source": [ "Then, plug the geometry representation back into an\n", @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8a47505", + "id": "2a687de5", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "c1dca878", + "id": "30b05526", "metadata": {}, "source": [ "## ST_Intersects, ST_Disjoint, ST_Crosses and ST_Overlaps\n", @@ -229,7 +229,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ab295b9", + "id": "4f94a5aa", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3792e629", + "id": "95254306", "metadata": {}, "outputs": [], "source": [ @@ -256,7 +256,7 @@ }, { "cell_type": "markdown", - "id": "b0df3a47", + "id": "fd3ff908", "metadata": {}, "source": [ "## ST_Touches\n", @@ -300,7 +300,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0392eca2", + "id": "b0bd3ad9", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "ddb9559f", + "id": "b76723a2", "metadata": {}, "source": [ "For testing whether two objects are within a distance of one another,\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13eabf16", + "id": "7ea82304", "metadata": {}, "outputs": [], "source": [ @@ -349,7 +349,7 @@ }, { "cell_type": "markdown", - "id": "cc7badec", + "id": "b6941765", "metadata": {}, "source": [ "And we can verify the answer on a map. The Broad St station is actually\n", @@ -409,7 +409,7 @@ { "cell_type": "code", "execution_count": null, - "id": "391b3128", + "id": "0a1eb455", "metadata": {}, "outputs": [], "source": [] diff --git a/_sources/book/postgis/sql_basics.ipynb b/_sources/book/postgis/sql_basics.ipynb index 43848be..a8c72d5 100644 --- a/_sources/book/postgis/sql_basics.ipynb +++ b/_sources/book/postgis/sql_basics.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "72034230", + "id": "b46a2022", "metadata": {}, "source": [ "# SQL Basics\n", @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "13d84796", + "id": "e6c2242f", "metadata": {}, "source": [ "## Connecting to the database" @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "737ebbc6", + "id": "7f8e465f", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72c59375", + "id": "d6dedb29", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4bd2f97b", + "id": "662d84b5", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dcb6fc8b", + "id": "3be7192a", "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e275c0eb", + "id": "1b79da21", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ { "cell_type": "code", "execution_count": null, - "id": "243a2a56", + "id": "e932f266", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "05b3f6cc", + "id": "9ef3ef2f", "metadata": {}, "source": [ "## The SQL SELECT statement" @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e98900f5", + "id": "27eef11b", "metadata": { "tags": [ "hide-output" @@ -121,7 +121,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0954b9f0", + "id": "bb9fa383", "metadata": {}, "outputs": [], "source": [ @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad850698", + "id": "556e7af5", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29101c3b", + "id": "1fbcafc3", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ce71782", + "id": "d464c7cb", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "620d2cf3", + "id": "73a8e964", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b853dc37", + "id": "481853a0", "metadata": {}, "outputs": [], "source": [ @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab6f24d4", + "id": "83c8c586", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b880339e", + "id": "56fd8b76", "metadata": {}, "outputs": [], "source": [ @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e536f480", + "id": "d826ed2c", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "4ec01f7f", + "id": "c7004e4a", "metadata": {}, "source": [ "## The WHERE Clause" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b63687e4", + "id": "50c8a60a", "metadata": { "tags": [ "hide-output" @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1ca0b99", + "id": "d34da555", "metadata": { "tags": [ "hide-output" @@ -269,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec30a946", + "id": "b4236ebf", "metadata": { "tags": [ "hide-output" @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bba9743", + "id": "b4056ead", "metadata": { "tags": [ "hide-output" @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4af64acd", + "id": "b21a334c", "metadata": { "tags": [ "hide-output" @@ -317,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b9c6cbe", + "id": "c2d3b24d", "metadata": { "tags": [ "hide-output" @@ -333,7 +333,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0cd2ccd2", + "id": "57487e9f", "metadata": { "tags": [ "hide-output" @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a7bcac05", + "id": "61a663ee", "metadata": { "tags": [ "hide-output" @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "b8158391", + "id": "768ac669", "metadata": {}, "source": [ "## SQL Joins\n", @@ -384,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e871f1f", + "id": "5dac2e4e", "metadata": {}, "outputs": [], "source": [ @@ -396,7 +396,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b90cf0bf", + "id": "885c69d7", "metadata": {}, "outputs": [], "source": [ @@ -408,7 +408,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3970324", + "id": "373f9012", "metadata": {}, "outputs": [], "source": [ @@ -420,7 +420,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e4e88a9", + "id": "e0a54143", "metadata": {}, "outputs": [], "source": [ @@ -431,7 +431,7 @@ }, { "cell_type": "markdown", - "id": "66f62480", + "id": "a3bf7708", "metadata": {}, "source": [ "### SQL Inner Join" @@ -440,7 +440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e2a0bee", + "id": "3b5db427", "metadata": { "tags": [ "hide-output" @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59b41c53", + "id": "6aabaf91", "metadata": { "tags": [ "hide-output" @@ -471,7 +471,7 @@ }, { "cell_type": "markdown", - "id": "975c3bd3", + "id": "98098e44", "metadata": {}, "source": [ "### SQL Left Join" @@ -480,7 +480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "add31b9b", + "id": "cf6d886c", "metadata": { "tags": [ "hide-output" @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "c18c7327", + "id": "b34d2e0c", "metadata": {}, "source": [ "### SQL Right Join" @@ -504,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41e50936", + "id": "ce0b76d6", "metadata": { "tags": [ "hide-output" @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "0b4495e3", + "id": "8936739c", "metadata": {}, "source": [ "### SQL Full Join" @@ -528,7 +528,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b2adcc17", + "id": "a7508c46", "metadata": { "tags": [ "hide-output" @@ -543,7 +543,7 @@ }, { "cell_type": "markdown", - "id": "ac59aab5", + "id": "da35ee28", "metadata": {}, "source": [ "### SQL Union" @@ -552,7 +552,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2242ff12", + "id": "0c3973dd", "metadata": { "tags": [ "hide-output" @@ -569,7 +569,7 @@ }, { "cell_type": "markdown", - "id": "d1d09a0c", + "id": "aeb30bb2", "metadata": {}, "source": [ "## Aggregation\n", @@ -580,7 +580,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc0ccdb4", + "id": "12c218f4", "metadata": { "tags": [ "hide-output" @@ -599,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "037d838a", + "id": "90ce3093", "metadata": { "tags": [ "hide-output" @@ -618,7 +618,7 @@ }, { "cell_type": "markdown", - "id": "d899127d", + "id": "7e692ba5", "metadata": {}, "source": [ "### Having" @@ -627,7 +627,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef6bf38d", + "id": "941c44e9", "metadata": {}, "outputs": [], "source": [ @@ -643,7 +643,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0dd1864", + "id": "2305dd6a", "metadata": {}, "outputs": [], "source": [ @@ -659,7 +659,7 @@ }, { "cell_type": "markdown", - "id": "1e455ec7", + "id": "0b65c935", "metadata": {}, "source": [ "## Conditional statements" @@ -668,7 +668,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2a69174", + "id": "7f23a432", "metadata": { "tags": [ "hide-output" @@ -689,7 +689,7 @@ }, { "cell_type": "markdown", - "id": "73fc49df", + "id": "03e39589", "metadata": {}, "source": [ "## Saving results" @@ -698,7 +698,7 @@ { "cell_type": "code", "execution_count": null, - "id": "345ee497", + "id": "35e7b276", "metadata": {}, "outputs": [], "source": [ @@ -712,7 +712,7 @@ { "cell_type": "code", "execution_count": null, - "id": "952dcd14", + "id": "c787abf7", "metadata": {}, "outputs": [], "source": [ @@ -729,7 +729,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4531340c", + "id": "6ff99c4a", "metadata": {}, "outputs": [], "source": [ @@ -743,7 +743,7 @@ }, { "cell_type": "markdown", - "id": "95c901f2", + "id": "3126ef04", "metadata": {}, "source": [ "## SQL Comments\n", @@ -754,7 +754,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25ea3eb6", + "id": "17f11328", "metadata": {}, "outputs": [], "source": [ @@ -765,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "20c48755", + "id": "3e651b38", "metadata": {}, "source": [ "### Multi-line comments" @@ -774,7 +774,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13c601a9", + "id": "fe35a794", "metadata": {}, "outputs": [], "source": [ @@ -794,7 +794,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c2fde94", + "id": "d8d2df7d", "metadata": {}, "outputs": [], "source": [] diff --git a/_sources/book/preface/instructor.ipynb b/_sources/book/preface/instructor.ipynb index 45b942a..3843d9a 100644 --- a/_sources/book/preface/instructor.ipynb +++ b/_sources/book/preface/instructor.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "312552d1", + "id": "14c7751b", "metadata": {}, "source": [ "# Instructor\n", diff --git a/_sources/book/preface/software.ipynb b/_sources/book/preface/software.ipynb index 16aded3..1484975 100644 --- a/_sources/book/preface/software.ipynb +++ b/_sources/book/preface/software.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "82918203", + "id": "cf555a33", "metadata": {}, "source": [ "# Software\n", diff --git a/_sources/book/preface/syllabus.ipynb b/_sources/book/preface/syllabus.ipynb index 3b55394..0068549 100644 --- a/_sources/book/preface/syllabus.ipynb +++ b/_sources/book/preface/syllabus.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "3d330fda", + "id": "ab182bdc", "metadata": {}, "source": [ "# Syllabus\n", diff --git a/_sources/book/python/01_getting_started.ipynb b/_sources/book/python/01_getting_started.ipynb index 3caba6c..0ae4b62 100644 --- a/_sources/book/python/01_getting_started.ipynb +++ b/_sources/book/python/01_getting_started.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "15382e70", + "id": "73d6cc15", "metadata": {}, "source": [ "# Getting Started\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f8c1ecc", + "id": "cb5dbf8a", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "18b9c87a", + "id": "f7bc823f", "metadata": {}, "source": [ "## Basic Operations\n", @@ -53,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a68ae9d", + "id": "48ceea9b", "metadata": {}, "outputs": [], "source": [ @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f3f892b", + "id": "801f7901", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f49a1efd", + "id": "c62adb33", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "26c6fc8b", + "id": "ab1a9d08", "metadata": {}, "source": [ "## Control Flow\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac6b1922", + "id": "c7315c9b", "metadata": {}, "outputs": [], "source": [ @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9224b7a5", + "id": "7a565e2a", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "727e72f1", + "id": "4933f5e9", "metadata": {}, "outputs": [], "source": [ @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "d2c16f13", + "id": "ed5e49a6", "metadata": {}, "source": [ "## Data Structures\n", @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28415812", + "id": "4e54f2d7", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a3bccec", + "id": "5cb4813b", "metadata": {}, "outputs": [], "source": [ @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4b7ef66d", + "id": "cc7eba12", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "75b58305", + "id": "5d49ec8d", "metadata": {}, "source": [ "## Functions\n", @@ -206,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bb53d9a2", + "id": "db1c8e2c", "metadata": {}, "outputs": [], "source": [ @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "89e0be71", + "id": "78bed077", "metadata": {}, "source": [ "## Input and Output\n", @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "143ec635", + "id": "4f05027a", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "43598803", + "id": "994600c7", "metadata": {}, "source": [ "## File Handling\n", @@ -256,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53b59c7c", + "id": "507cf4d4", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "60da1b18", + "id": "961e872a", "metadata": {}, "source": [ "## Exception Handling\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d3a738e", + "id": "4c3472ce", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/python/02_variables_data_types.ipynb b/_sources/book/python/02_variables_data_types.ipynb index f3b231d..7e6ec1d 100644 --- a/_sources/book/python/02_variables_data_types.ipynb +++ b/_sources/book/python/02_variables_data_types.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "610c73a4", + "id": "6b471aa8", "metadata": {}, "source": [ "# Variables and Data Types\n", @@ -25,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe7c2741", + "id": "1295fb91", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "markdown", - "id": "8c814795", + "id": "adb5c1e5", "metadata": {}, "source": [ "We’ve added a _variable_ named message. Every variable is connected to a value, which is the information associated with that variable. In this case the value is the `\"Hello Python world!\"` text. Adding a variable makes a little more work for the Python interpreter. When it processes the first line, it associates the variable message with the `\"Hello Python world!\"` text. When it reaches the second line, it prints the value associated with message to the screen. Let’s expand on this program by adding two new lines of code:" @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d469185", + "id": "bbe87e54", "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "77d836c4", + "id": "bac60712", "metadata": {}, "source": [ "You can change the value of a variable in your program at any time, and Python will always keep track of its current value.\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ea9f406", + "id": "c2ca6870", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "3d6bf5f3", + "id": "71ee8d93", "metadata": {}, "source": [ "When an error occurs in your program, the Python interpreter does its best to help you figure out where the problem is. The interpreter provides a traceback when a program cannot run successfully. A traceback is a record of where the interpreter ran into trouble when trying to execute your code. Here’s an example of the traceback that Python provides after you’ve accidentally misspelled a variable’s name. Let's fix it:" @@ -98,7 +98,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c64c2b62", + "id": "9bcf6d0e", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "53b874c8", + "id": "d9c99177", "metadata": {}, "source": [ "### Strings\n", @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4b0fde7", + "id": "5914adfd", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "16069ed3", + "id": "539543b9", "metadata": {}, "source": [ "In this example, the variable name refers to the lowercase string \"ada lovelace\". The method title() appears after the variable in the print() call. A method is an action that Python can perform on a piece of data. The dot (.) after name in name.title() tells Python to make the title() method act on the variable name. Every method is followed by a set of parentheses, because methods often need additional information to do their work. That informa- tion is provided inside the parentheses. The title() function doesn’t need any additional information, so its parentheses are empty. The title() method changes each word to title case, where each word begins with a capital letter. This is useful because you’ll often want to think of a name as a piece of information. For example, you might want your pro- gram to recognize the input values Ada, ADA, and ada as the same name, and display all of them as Ada. Several other useful methods are available for dealing with case as well. For example, you can change a string to all uppercase or all lowercase letters like this:" @@ -155,7 +155,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5bc919a", + "id": "f9a5b52b", "metadata": {}, "outputs": [], "source": [ @@ -166,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "d7354967", + "id": "1b3fd1d8", "metadata": {}, "source": [ "### Using Variables in Strings\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15d2e347", + "id": "05524ddf", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ }, { "cell_type": "markdown", - "id": "54058224", + "id": "0f058c63", "metadata": {}, "source": [ "To insert a variable’s value into a string, place the letter f immediately before the opening quotation mark. Put braces around the name or names of any variable you want to use inside the string. Python will replace each variable with its value when the string is displayed. These strings are called f-strings. The f is for format, because Python formats the string by replacing the name of any variable in braces with its value." @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "442938f2", + "id": "91cdbc4a", "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf8221c9", + "id": "5f3bd917", "metadata": {}, "outputs": [], "source": [ @@ -222,7 +222,7 @@ }, { "cell_type": "markdown", - "id": "07a0868b", + "id": "10cc8fa8", "metadata": {}, "source": [ "### Adding Whitespace to Strings with Tabs or Newlines\n", @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb7a34cb", + "id": "caf2679b", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "42199080", + "id": "cb4e5b2e", "metadata": {}, "source": [ "To add a newline in a string, use the character combination \\n:" @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2447f378", + "id": "3193a1ba", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "ee732eba", + "id": "90e3a947", "metadata": {}, "source": [ "You can also combine tabs and newlines in a single string. The string \"\\n\\t\" tells Python to move to a new line, and start the next line with a tab. The following example shows how you can use a one-line string to generate\n", @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ef2de4c", + "id": "5a8f277b", "metadata": {}, "outputs": [], "source": [ @@ -281,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "80314e9f", + "id": "38f66638", "metadata": {}, "source": [ "### Stripping Whitespace\n", @@ -295,7 +295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f622d7f", + "id": "502f92f3", "metadata": {}, "outputs": [], "source": [ @@ -307,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ceec944", + "id": "c24ab907", "metadata": {}, "outputs": [], "source": [ @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "428746e4", + "id": "1e346745", "metadata": {}, "source": [ "### Avoiding Syntax Errors with Strings\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cde8db14", + "id": "71a13ec3", "metadata": {}, "outputs": [], "source": [ @@ -343,7 +343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6719017b", + "id": "ae770b7a", "metadata": {}, "outputs": [], "source": [ @@ -353,7 +353,7 @@ }, { "cell_type": "markdown", - "id": "354c5ff8", + "id": "54a1cb72", "metadata": {}, "source": [ "## Numbers\n", @@ -368,7 +368,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2479a1c", + "id": "aa292b16", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6b44632", + "id": "ac0b3fd6", "metadata": {}, "outputs": [], "source": [ @@ -388,7 +388,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92440ae1", + "id": "410450f6", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ { "cell_type": "code", "execution_count": null, - "id": "030d52ca", + "id": "8e4f98c9", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "468c7ba9", + "id": "68c35e30", "metadata": {}, "source": [ "Python simply returns the result of the Python uses two multiplication symbols to represent exponents:" @@ -416,7 +416,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bf6d656", + "id": "3e383655", "metadata": {}, "outputs": [], "source": [ @@ -426,7 +426,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fc2f0478", + "id": "57a83565", "metadata": {}, "outputs": [], "source": [ @@ -436,7 +436,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e0f0dae", + "id": "c1b5c55a", "metadata": {}, "outputs": [], "source": [ @@ -445,7 +445,7 @@ }, { "cell_type": "markdown", - "id": "c8a984d8", + "id": "4f6ebee5", "metadata": {}, "source": [ "Python supports the order of operations too, so you can use multiple operations in one expression. You can also use parentheses to modify the order of operations so Python can evaluate your expression in the order you specify. For example:" @@ -454,7 +454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f6e5bf5", + "id": "0205e8fb", "metadata": {}, "outputs": [], "source": [ @@ -464,7 +464,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e5c7e15", + "id": "f51332ea", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ }, { "cell_type": "markdown", - "id": "3202ad0f", + "id": "d553c02d", "metadata": {}, "source": [ "### Floats\n", @@ -484,7 +484,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac9ae9e7", + "id": "6c6c5c30", "metadata": {}, "outputs": [], "source": [ @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f6a91e1", + "id": "7fd54fb7", "metadata": {}, "outputs": [], "source": [ @@ -503,7 +503,7 @@ }, { "cell_type": "markdown", - "id": "871f754b", + "id": "678d9040", "metadata": {}, "source": [ "But be aware that you can sometimes get an arbitrary number of decimal places in your answer. This happens in all languages and is of little concern. Python tries to find a way to represent the result as precisely as possible, which is sometimes difficult given how computers have to represent numbers internally. Just ignore the extra decimal places for now; you’ll learn ways to deal with this later." @@ -512,7 +512,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb5c6c32", + "id": "99c9b671", "metadata": {}, "outputs": [], "source": [ @@ -521,7 +521,7 @@ }, { "cell_type": "markdown", - "id": "f5e2bd86", + "id": "c6adcbb8", "metadata": {}, "source": [ "### Integers and Floats\n", @@ -532,7 +532,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46d5f419", + "id": "494a24e2", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +541,7 @@ }, { "cell_type": "markdown", - "id": "8f748e4e", + "id": "6e987dcf", "metadata": {}, "source": [ "If you mix an integer and a float in any other operation, you’ll get a float as well:" @@ -550,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5de9625f", + "id": "7046dd41", "metadata": {}, "outputs": [], "source": [ @@ -559,7 +559,7 @@ }, { "cell_type": "markdown", - "id": "617533c5", + "id": "584433e4", "metadata": {}, "source": [ "### Underscores in Numbers\n", @@ -570,7 +570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e1b7955", + "id": "b8395ac5", "metadata": {}, "outputs": [], "source": [ @@ -580,7 +580,7 @@ }, { "cell_type": "markdown", - "id": "e404d332", + "id": "9a636567", "metadata": {}, "source": [ "### Multiple Assignment\n", @@ -591,7 +591,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06c32de7", + "id": "1b1a55f3", "metadata": {}, "outputs": [], "source": [ @@ -600,7 +600,7 @@ }, { "cell_type": "markdown", - "id": "8fa555fc", + "id": "2ee66faf", "metadata": {}, "source": [ "You need to separate the variable names with commas, and do the same with the values, and Python will assign each value to its respectively positioned variable. As long as the number of values matches the number of variables, Python will match them up correctly.\n", @@ -613,7 +613,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19388286", + "id": "9c11b9d7", "metadata": {}, "outputs": [], "source": [ @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "3cba86fe", + "id": "cbd42fd6", "metadata": {}, "source": [ "## Comments\n", @@ -637,7 +637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19ed2c6f", + "id": "239b3238", "metadata": {}, "outputs": [], "source": [ @@ -647,7 +647,7 @@ }, { "cell_type": "markdown", - "id": "8936aa16", + "id": "f29b31f5", "metadata": {}, "source": [ "### Shortcut for making comments in Jupyter Notebook\n", diff --git a/_sources/book/python/03_introducing_lists.ipynb b/_sources/book/python/03_introducing_lists.ipynb index d048166..97aa25a 100644 --- a/_sources/book/python/03_introducing_lists.ipynb +++ b/_sources/book/python/03_introducing_lists.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "4921e74e", + "id": "9398a507", "metadata": {}, "source": [ "# Introducing List\n", @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "71fb700b", + "id": "6f115517", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "markdown", - "id": "26d30cff", + "id": "c7a5285a", "metadata": {}, "source": [ "## What is a List?\n", @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f48ff87", + "id": "f2dfc23f", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "0c121892", + "id": "99421312", "metadata": {}, "source": [ "### Accessing Elements in a List\n", @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd577347", + "id": "cf208b20", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "2cf7e785", + "id": "57066d10", "metadata": {}, "source": [ "You can also use the string methods from Chapter 2 on any element in this list. For example, you can format the element 'trek' more neatly by using the title() method:" @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dcc047b", + "id": "17abeb7d", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ }, { "cell_type": "markdown", - "id": "13539fd4", + "id": "ee86aca0", "metadata": {}, "source": [ "### Index Positions Start at 0, Not 1\n", @@ -117,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24cc201c", + "id": "bd121ca8", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "7c49a641", + "id": "17010c70", "metadata": {}, "source": [ "Python has a special syntax for accessing the last element in a list. By ask ing for the item at index -1, Python always returns the last item in the list:" @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1dad5e91", + "id": "534e8e17", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ }, { "cell_type": "markdown", - "id": "9b3f4f4d", + "id": "5a50bed5", "metadata": {}, "source": [ "### Using Individual Values from a List\n", @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c92d043c", + "id": "fe847aa6", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +168,7 @@ }, { "cell_type": "markdown", - "id": "3ad64f9a", + "id": "1c82c18f", "metadata": {}, "source": [ "## Changing, Adding, and Removing Elements\n", @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d12ef96a", + "id": "e3607909", "metadata": {}, "outputs": [], "source": [ @@ -195,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39314d53", + "id": "ff579237", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "eb97541f", + "id": "7aaf3170", "metadata": {}, "source": [ "### Adding Elements to a List\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3a602be", + "id": "11b94404", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "631431e5", + "id": "a84615fa", "metadata": {}, "source": [ "The append() method makes it easy to build lists dynamically. For example, you can start with an empty list and then add items to the list using a series of append() calls. Using an empty list, let’s add the elements 'honda', 'yamaha', and 'suzuki' to the list:" @@ -239,7 +239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ae194bd", + "id": "bf41c40e", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "0a8fe7d8", + "id": "7395284c", "metadata": {}, "source": [ "### Inserting Elements into a List\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a18fe8f", + "id": "6f0e8212", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "968e85a2", + "id": "0b401835", "metadata": {}, "source": [ "### Removing Elements from a List\n", @@ -287,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f129ca90", + "id": "26d346d9", "metadata": {}, "outputs": [], "source": [ @@ -300,7 +300,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e08f43e1", + "id": "e482dbf4", "metadata": {}, "outputs": [], "source": [ @@ -310,7 +310,7 @@ }, { "cell_type": "markdown", - "id": "60f3b0fd", + "id": "9c5ab59c", "metadata": {}, "source": [ "### Removing an Item Using the pop() Method\n", @@ -321,7 +321,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e6f8a927", + "id": "9f2667b0", "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0cdf310", + "id": "706a0705", "metadata": {}, "outputs": [], "source": [ @@ -346,7 +346,7 @@ }, { "cell_type": "markdown", - "id": "5bdbafbd", + "id": "da0ea4f9", "metadata": {}, "source": [ "### Popping Items from any Position in a List\n", @@ -357,7 +357,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fac6de53", + "id": "2513fe98", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f44ae1c", + "id": "2aa768a0", "metadata": {}, "outputs": [], "source": [ @@ -378,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "d7a0e69a", + "id": "5e1433f8", "metadata": {}, "source": [ "### Removing an Item by Value\n", @@ -389,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a2c9011", + "id": "d3bfc3f5", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "e0af0587", + "id": "42e7804c", "metadata": {}, "source": [ "You can also use the remove() method to work with a value that’s being removed from a list. Let’s remove the value 'ducati' and print a reason for removing it from the list:" @@ -410,7 +410,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47f6a57f", + "id": "87af9c67", "metadata": {}, "outputs": [], "source": [ @@ -424,7 +424,7 @@ }, { "cell_type": "markdown", - "id": "2ef95b9c", + "id": "170b2821", "metadata": {}, "source": [ "## Organizing a List\n", @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26c1b799", + "id": "5e6ac821", "metadata": {}, "outputs": [], "source": [ @@ -450,7 +450,7 @@ }, { "cell_type": "markdown", - "id": "9cd5e5c6", + "id": "09fd0013", "metadata": {}, "source": [ "You can also sort this list in reverse alphabetical order by passing the argument reverse=True to the sort() method. The following example sorts the list of cars in reverse alphabetical order:" @@ -459,7 +459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20660562", + "id": "27c373e6", "metadata": {}, "outputs": [], "source": [ @@ -470,7 +470,7 @@ }, { "cell_type": "markdown", - "id": "84d069bc", + "id": "386c787a", "metadata": {}, "source": [ "### Sorting a List Temporarily with the sorted() Function\n", @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38dfea22", + "id": "61a79cf1", "metadata": {}, "outputs": [], "source": [ @@ -496,7 +496,7 @@ }, { "cell_type": "markdown", - "id": "5b6d61cf", + "id": "2bd6c08c", "metadata": {}, "source": [ "### Printing a List in Reverse Order\n", @@ -507,7 +507,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53dcd342", + "id": "138fa879", "metadata": {}, "outputs": [], "source": [ @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "211131fa", + "id": "8646a99d", "metadata": {}, "source": [ "### Finding the Length of a List\n", @@ -530,7 +530,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f77b452", + "id": "4160e44b", "metadata": {}, "outputs": [], "source": [ @@ -540,7 +540,7 @@ }, { "cell_type": "markdown", - "id": "248be04a", + "id": "b73497fb", "metadata": {}, "source": [ "## Avoiding Index Errors When Working with Lists\n", @@ -551,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1098ecf7", + "id": "203d5968", "metadata": {}, "outputs": [], "source": [ @@ -561,7 +561,7 @@ }, { "cell_type": "markdown", - "id": "793e8177", + "id": "e7e5be3b", "metadata": {}, "source": [ "Python attempts to give you the item at index 3. But when it searches the list, no item in motorcycles has an index of 3. Because of the off-by-one nature of indexing in lists, this error is typical. People think the third item is item number 3, because they start counting at 1. But in Python the third item is number 2, because it starts indexing at 0.\n", @@ -574,7 +574,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da58e704", + "id": "67ee643b", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18ccdaab", + "id": "fccc53a1", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/python/04_working_with_lists.ipynb b/_sources/book/python/04_working_with_lists.ipynb index 7deaa08..980a178 100644 --- a/_sources/book/python/04_working_with_lists.ipynb +++ b/_sources/book/python/04_working_with_lists.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "1272ba75", + "id": "3e4f544d", "metadata": {}, "source": [ "# Working with Lists\n", @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb46a829", + "id": "f3a30b24", "metadata": {}, "outputs": [], "source": [ @@ -41,7 +41,7 @@ }, { "cell_type": "markdown", - "id": "fae15d09", + "id": "ed8cec36", "metadata": {}, "source": [ "When you’re using loops for the first time, keep in mind that the set of steps is repeated once for each item in the list, no matter how many items are in the list. If you have a million items in your list, Python repeats these steps a million times—and usually very quickly. Also keep in mind when writing your own for loops that you can choose any name you want for the temporary variable that will be associated with each value in the list. However, it’s helpful to choose a meaningful name that represents a single item from the list.\n", @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f045b3e3", + "id": "9f8bdbb2", "metadata": {}, "outputs": [], "source": [ @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7eb19d6", + "id": "31d7ebfc", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "b505d9fb", + "id": "900481c3", "metadata": {}, "source": [ "### Doing Something After a for Loop\n", @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65945cdf", + "id": "6209352b", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "4a80b0f9", + "id": "ddabf69a", "metadata": {}, "source": [ "## Avoiding Indentation Errors\n", @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c87b5991", + "id": "edf800e7", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "28621550", + "id": "561fa6e2", "metadata": {}, "source": [ "### Forgetting to Indent Additional Lines\n", @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c1913119", + "id": "3caa2c39", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "d9513926", + "id": "1b80f8d0", "metadata": {}, "source": [ "### Indenting Unnecessarily\n", @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2396f49", + "id": "b4304804", "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "1e2c04b9", + "id": "372865a9", "metadata": {}, "source": [ "### Indenting Unnecessarily\n", @@ -190,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ae2766f", + "id": "0b5781de", "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "18f53269", + "id": "77fc1bcb", "metadata": {}, "source": [ "How to print element index and content together?" @@ -213,7 +213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe19e18a", + "id": "e3571333", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ }, { "cell_type": "markdown", - "id": "95172caf", + "id": "d8934640", "metadata": {}, "source": [ "### Forgetting the Colon\n", @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3bdac9e5", + "id": "a74d4a27", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "00a4161a", + "id": "cb0d8915", "metadata": {}, "source": [ "## Making Numerical Lists\n", @@ -263,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5469a19e", + "id": "274f34b1", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +273,7 @@ }, { "cell_type": "markdown", - "id": "00638ec4", + "id": "5951762f", "metadata": {}, "source": [ "In this example, range() prints only the numbers 1 through 4. This is another result of the off-by-one behavior you’ll see often in programming languages. The range() function causes Python to start counting at the first value you give it, and it stops when it reaches the second value you provide. Because it stops at that second value, the output never contains the end value, which would have been 5 in this case." @@ -282,7 +282,7 @@ { "cell_type": "code", "execution_count": null, - "id": "02d0b344", + "id": "12196a1c", "metadata": {}, "outputs": [], "source": [ @@ -292,7 +292,7 @@ }, { "cell_type": "markdown", - "id": "9ff09329", + "id": "7d448309", "metadata": {}, "source": [ "### Using range() to Make a List of Numbers\n", @@ -303,7 +303,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bfc55cfa", + "id": "c0e63d25", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "5ee1f986", + "id": "60f93279", "metadata": {}, "source": [ "We can also use the range() function to tell Python to skip numbers in a given range. If you pass a third argument to range(), Python uses that value as a step size when generating numbers. For example, here’s how to list the even numbers between 1 and 10:" @@ -322,7 +322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e9559a84", + "id": "6e0d3431", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "2fd7322e", + "id": "a46f86e3", "metadata": {}, "source": [ "You can create almost any set of numbers you want to using the range() function. For example, consider how you might make a list of the first 10 square numbers (that is, the square of each integer from 1 through 10). In Python, two asterisks (\\*\\*) represent exponents. Here’s how you might put the first 10 square numbers into a list:" @@ -341,7 +341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63856bd6", + "id": "609572f3", "metadata": {}, "outputs": [], "source": [ @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "62e912b6", + "id": "368c0e62", "metadata": {}, "source": [ "To write this code more concisely, omit the temporary variable square and append each new value directly to the list:" @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0124f089", + "id": "729bc6ef", "metadata": {}, "outputs": [], "source": [ @@ -375,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "441517cd", + "id": "5558354c", "metadata": {}, "source": [ "### Simple Statistics with a List of Numbers\n", @@ -386,7 +386,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6850b5d", + "id": "84bd5360", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b369de43", + "id": "75010b99", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7db8422c", + "id": "5a97a1f9", "metadata": {}, "outputs": [], "source": [ @@ -416,7 +416,7 @@ }, { "cell_type": "markdown", - "id": "755c4665", + "id": "475f8d87", "metadata": {}, "source": [ "### List Comprehensions\n", @@ -429,7 +429,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7214f2f", + "id": "d11cdf95", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +439,7 @@ }, { "cell_type": "markdown", - "id": "3ae82b4e", + "id": "77199efe", "metadata": {}, "source": [ "To use this syntax, begin with a descriptive name for the list, such as squares. Next, open a set of square brackets and define the expression for the values you want to store in the new list. In this example the expression is value ** 2, which raises the value to the second power. Then, write a for loop to generate the numbers you want to feed into the expression, and close the square brackets. The for loop in this example is for value in range(1, 11), which feeds the values 1 through 10 into the expression value ** 2. Notice that no colon is used at the end of the for statement.\n", @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "939c4520", + "id": "2d4ab944", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +467,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34a7ed0e", + "id": "5e68c5ce", "metadata": {}, "outputs": [], "source": [ @@ -477,7 +477,7 @@ }, { "cell_type": "markdown", - "id": "71be92da", + "id": "d4ca8497", "metadata": {}, "source": [ "If you omit the first index in a slice, Python automatically starts your slice at the beginning of the list:" @@ -486,7 +486,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a389a8f", + "id": "88a74b0a", "metadata": {}, "outputs": [], "source": [ @@ -496,7 +496,7 @@ }, { "cell_type": "markdown", - "id": "4871be17", + "id": "80ddaa8d", "metadata": {}, "source": [ "A similar syntax works if you want a slice that includes the end of a list. For example, if you want all items from the third item through the last item, you can start with index 2 and omit the second index:" @@ -505,7 +505,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec59b610", + "id": "b4204715", "metadata": {}, "outputs": [], "source": [ @@ -515,7 +515,7 @@ }, { "cell_type": "markdown", - "id": "b243aa5e", + "id": "5e9545ba", "metadata": {}, "source": [ "This syntax allows you to output all of the elements from any point in your list to the end regardless of the length of the list. Recall that a negative index returns an element a certain distance from the end of a list; therefore, you can output any slice from the end of a list. For example, if we want to output the last three players on the roster, we can use the slice players[-3:]:" @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffefab69", + "id": "29aab4b4", "metadata": {}, "outputs": [], "source": [ @@ -534,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "4f48bef4", + "id": "13c8170d", "metadata": {}, "source": [ "### Looping Through a Slice\n", @@ -545,7 +545,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6705404", + "id": "21171841", "metadata": {}, "outputs": [], "source": [ @@ -557,7 +557,7 @@ }, { "cell_type": "markdown", - "id": "4273062b", + "id": "6c027df3", "metadata": {}, "source": [ "### Copying a List\n", @@ -572,7 +572,7 @@ { "cell_type": "code", "execution_count": null, - "id": "769aeee8", + "id": "746f607f", "metadata": {}, "outputs": [], "source": [ @@ -586,7 +586,7 @@ }, { "cell_type": "markdown", - "id": "3e3d133b", + "id": "f7d0d314", "metadata": {}, "source": [ "To prove that we actually have two separate lists, we’ll add a new food to each list and show that each list keeps track of the appropriate person’s favorite foods:" @@ -595,7 +595,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f406865", + "id": "01b84cb6", "metadata": {}, "outputs": [], "source": [ @@ -612,7 +612,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e97c5e3", + "id": "6002e3dd", "metadata": {}, "outputs": [], "source": [ @@ -629,7 +629,7 @@ }, { "cell_type": "markdown", - "id": "e7611ded", + "id": "1ae9f843", "metadata": {}, "source": [ "## Tuples\n", @@ -644,7 +644,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f0200146", + "id": "a49ae330", "metadata": {}, "outputs": [], "source": [ @@ -655,7 +655,7 @@ }, { "cell_type": "markdown", - "id": "e4c7c8db", + "id": "d74dd73b", "metadata": {}, "source": [ "Let’s see what happens if we try to change one of the items in the tuple dimensions:" @@ -664,7 +664,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cdff6be4", + "id": "ae152de2", "metadata": {}, "outputs": [], "source": [ @@ -674,7 +674,7 @@ }, { "cell_type": "markdown", - "id": "840905e0", + "id": "50cc2377", "metadata": {}, "source": [ "Tuples are technically defined by the presence of a comma; the parentheses make them look neater and more readable. If you want to define a tuple with one element, you need to include a trailing comma:" @@ -683,7 +683,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6515afcc", + "id": "01cc2df3", "metadata": {}, "outputs": [], "source": [ @@ -692,7 +692,7 @@ }, { "cell_type": "markdown", - "id": "9f2d6e4f", + "id": "c222f03a", "metadata": {}, "source": [ "### Looping Through All Values in a Tuple\n", @@ -703,7 +703,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29af9526", + "id": "b0c6a490", "metadata": {}, "outputs": [], "source": [ @@ -714,7 +714,7 @@ }, { "cell_type": "markdown", - "id": "2e3c8a51", + "id": "db5aaaa0", "metadata": {}, "source": [ "### Writing over a Tuple\n", @@ -725,7 +725,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27712327", + "id": "18680e12", "metadata": {}, "outputs": [], "source": [ diff --git a/_sources/book/python/05_if_statements.ipynb b/_sources/book/python/05_if_statements.ipynb index b814a96..659bbf9 100644 --- a/_sources/book/python/05_if_statements.ipynb +++ b/_sources/book/python/05_if_statements.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5043510f", + "id": "0fe2eac1", "metadata": {}, "source": [ "# Conditional Statements\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "329e7919", + "id": "e2ed8ed6", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "0a04b693", + "id": "11cb4298", "metadata": {}, "source": [ "## CONDITIONAL TESTS\n", @@ -61,7 +61,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba399df6", + "id": "93416d54", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "markdown", - "id": "63e1900e", + "id": "881010ef", "metadata": {}, "source": [ "The line at ➊ sets the value of car to 'bmw' using a single equal sign, as you’ve seen many times already. The line at ➋ checks whether the value of car is 'bmw' using a double equal sign (==). This equality operator returns True if the values on the left and right side of the operator match, and False if they don’t match. The values in this example match, so Python returns True." @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "662f24ba", + "id": "f13c2dbf", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "fc880d54", + "id": "d87a289e", "metadata": {}, "source": [ "A single equal sign is really a statement; you might read the code at ➊ as “Set the value of car equal to 'audi'.” On the other hand, a double equal sign, like the one at ➋, asks a question: “Is the value of car equal to 'bmw'?” Most programming languages use equal signs in this way.\n", @@ -103,7 +103,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f42b2735", + "id": "c61ff10a", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "3d74a912", + "id": "976bb801", "metadata": {}, "source": [ "If case matters, this behavior is advantageous. But if case doesn’t matter and instead you just want to test the value of a variable, you can convert the variable’s value to lowercase before doing the comparison:" @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a0d85731", + "id": "9bb747f3", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "a50a2c55", + "id": "acea927a", "metadata": {}, "source": [ "This test would return True no matter how the value 'Audi' is formatted because the test is now case insensitive. The lower() function doesn’t change the value that was originally stored in car, so you can do this kind of comparison without affecting the original variable:" @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f31ba87c", + "id": "4d02076a", "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1ab3bac", + "id": "b51e670d", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "fdb32094", + "id": "bc8319cb", "metadata": {}, "source": [ "Websites enforce certain rules for the data that users enter in a manner similar to this. For example, a site might use a conditional test like this to ensure that every user has a truly unique username, not just a variation on the capitalization of another person’s username. When someone submits a new username, that new username is converted to lowercase and compared to the lowercase versions of all existing usernames. During this check, a username like 'John' will be rejected if any variation of 'john' is already in use.\n", @@ -176,7 +176,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c947df2e", + "id": "43effc4d", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "11630d6f", + "id": "20b323d2", "metadata": {}, "source": [ "### Numerical Comparisons\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2dd2f3ef", + "id": "22552294", "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "bc82b2f0", + "id": "b745e4ed", "metadata": {}, "source": [ "You can also test to see if two numbers are not equal. For example, the following code prints a message if the given answer is not correct:" @@ -217,7 +217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "441806c1", + "id": "5cff3e2c", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "0c861616", + "id": "3ac49ce6", "metadata": {}, "source": [ "You can include various mathematical comparisons in your conditional statements as well, such as less than, less than or equal to, greater than, and greater than or equal to:" @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86769f9b", + "id": "753ed206", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "334a1694", + "id": "8340fdf1", "metadata": {}, "outputs": [], "source": [ @@ -258,7 +258,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59492602", + "id": "e38f8d32", "metadata": {}, "outputs": [], "source": [ @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b97a80c", + "id": "1802f876", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "dd0b3428", + "id": "7fe9402f", "metadata": {}, "source": [ "### Checking Multiple Conditions\n", @@ -294,7 +294,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2fd1e539", + "id": "de55a904", "metadata": {}, "outputs": [], "source": [ @@ -306,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e5256f9", + "id": "a6d37cfc", "metadata": {}, "outputs": [], "source": [ @@ -316,7 +316,7 @@ }, { "cell_type": "markdown", - "id": "c3bf5d3c", + "id": "5ca56625", "metadata": {}, "source": [ "To improve readability, you can use parentheses around the individual tests, but they are not required. If you use parentheses, your test would look like this:" @@ -325,7 +325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "651243a8", + "id": "df9de2c3", "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "da8f7c4b", + "id": "75a9c101", "metadata": {}, "source": [ "### Using or to Check Multiple Conditions\n", @@ -347,7 +347,7 @@ { "cell_type": "code", "execution_count": null, - "id": "91cfbb4c", + "id": "1f03e6a9", "metadata": {}, "outputs": [], "source": [ @@ -359,7 +359,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a15b90d8", + "id": "502f75f2", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "40777f9e", + "id": "59dc162d", "metadata": {}, "source": [ "### Checking Whether a Value Is in a List\n", @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "359a5ee6", + "id": "95196d83", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d6573bb", + "id": "baeb4f65", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "648cd270", + "id": "3482a633", "metadata": {}, "source": [ "### Checking Whether a Value Is Not in a List\n", @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f1582d8c", + "id": "9414bb59", "metadata": {}, "outputs": [], "source": [ @@ -426,7 +426,7 @@ }, { "cell_type": "markdown", - "id": "2e2156e7", + "id": "5408c87a", "metadata": {}, "source": [ "### Boolean Expressions\n", @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "333e3385", + "id": "48c3041e", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +449,7 @@ }, { "cell_type": "markdown", - "id": "440d8264", + "id": "27f87b35", "metadata": {}, "source": [ "## IF STATEMENTS\n", @@ -473,7 +473,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5410d451", + "id": "afe2679a", "metadata": {}, "outputs": [], "source": [ @@ -484,7 +484,7 @@ }, { "cell_type": "markdown", - "id": "9ce94780", + "id": "4686f89a", "metadata": {}, "source": [ "Indentation plays the same role in if statements as it did in for loops. All indented lines after an if statement will be executed if the test passes, and the entire block of indented lines will be ignored if the test does not pass.\n", @@ -495,7 +495,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea98bebb", + "id": "4a33bda1", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "b793563a", + "id": "cacf6103", "metadata": {}, "source": [ "### if-else Statements\n", @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "50034253", + "id": "7c469f29", "metadata": {}, "outputs": [], "source": [ @@ -535,7 +535,7 @@ }, { "cell_type": "markdown", - "id": "96334675", + "id": "868f214e", "metadata": {}, "source": [ "### The if-elif-else Chain\n", @@ -554,7 +554,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ba53467", + "id": "c27ac8b8", "metadata": {}, "outputs": [], "source": [ @@ -574,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "73ac5ec2", + "id": "f396fbe4", "metadata": {}, "source": [ "### Using Multiple elif Blocks\n", @@ -585,7 +585,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72e226dc", + "id": "525519c5", "metadata": {}, "outputs": [], "source": [ @@ -605,7 +605,7 @@ }, { "cell_type": "markdown", - "id": "48455048", + "id": "d99a561e", "metadata": {}, "source": [ "The else block is a catchall statement. It matches any condition that wasn’t matched by a specific if or elif test, and that can sometimes include invalid or even malicious data. If you have a specific final condition you are testing for, consider using a final elif block and omit the else block. As a result, you’ll gain extra confidence that your code will run only under the correct conditions.\n", @@ -622,7 +622,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1526826f", + "id": "a3d587b9", "metadata": {}, "outputs": [], "source": [ @@ -640,7 +640,7 @@ }, { "cell_type": "markdown", - "id": "e6ac636f", + "id": "34ee0a59", "metadata": {}, "source": [ "This code would not work properly if we used an if-elif-else block, because the code would stop running after only one test passes. Here’s what that would look like:" @@ -649,7 +649,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e1871e9", + "id": "a42d1ca8", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +667,7 @@ }, { "cell_type": "markdown", - "id": "67db25f9", + "id": "b65ce67d", "metadata": {}, "source": [ "In summary, if you want only one block of code to run, use an if-elif-else chain. If more than one block of code needs to run, use a series of independent if statements.\n", @@ -686,7 +686,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6814266c", + "id": "bab3b262", "metadata": {}, "outputs": [], "source": [ @@ -700,7 +700,7 @@ }, { "cell_type": "markdown", - "id": "8e6852a3", + "id": "f7c35868", "metadata": {}, "source": [ "The output is straightforward because this code is just a simple for loop. But what if the pizzeria runs out of green peppers? An if statement inside the for loop can handle this situation appropriately:" @@ -709,7 +709,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25fb2f4a", + "id": "565f13d1", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +726,7 @@ }, { "cell_type": "markdown", - "id": "28df118b", + "id": "d43bc190", "metadata": {}, "source": [ "### Checking That a List Is Not Empty\n", @@ -739,7 +739,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53fffd92", + "id": "36e01995", "metadata": {}, "outputs": [], "source": [ @@ -755,7 +755,7 @@ }, { "cell_type": "markdown", - "id": "45a42f43", + "id": "549336d9", "metadata": {}, "source": [ "### Using Multiple Lists\n", @@ -768,7 +768,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33914fc4", + "id": "4d7e63d5", "metadata": {}, "outputs": [], "source": [ @@ -787,7 +787,7 @@ }, { "cell_type": "markdown", - "id": "d5e202f9", + "id": "30d65034", "metadata": {}, "source": [ "## STYLING YOUR IF STATEMENTS\n", diff --git a/_sources/book/python/06_dictionaries.ipynb b/_sources/book/python/06_dictionaries.ipynb index 3600847..5cada14 100644 --- a/_sources/book/python/06_dictionaries.ipynb +++ b/_sources/book/python/06_dictionaries.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d7af7a1a", + "id": "0ef21030", "metadata": {}, "source": [ "# Dictionaries\n", @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d09dd47", + "id": "3ea6ecc0", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +42,7 @@ }, { "cell_type": "markdown", - "id": "f71fdeaf", + "id": "07e0cf33", "metadata": {}, "source": [ "## WORKING WITH DICTIONARIES\n", @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fdbae738", + "id": "1f4c68de", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "04f7a7ab", + "id": "6192e478", "metadata": {}, "source": [ "A key-value pair is a set of values associated with each other. When you provide a key, Python returns the value associated with that key. Every key is connected to its value by a colon, and individual key-value pairs are separated by commas. You can store as many key-value pairs as you want in a dictionary. The simplest dictionary has exactly one key-value pair, as shown in this modified version of the alien_0 dictionary:" @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d01e5ec7", + "id": "90a8c221", "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "markdown", - "id": "d51e4473", + "id": "bdceabc9", "metadata": {}, "source": [ "### Accessing Values in a Dictionary\n", @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73615585", + "id": "ebb4058a", "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "markdown", - "id": "7b8d584e", + "id": "9c20a010", "metadata": {}, "source": [ "### Adding New Key-Value Pairs\n", @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f16c4fba", + "id": "d593ed60", "metadata": {}, "outputs": [], "source": [ @@ -129,7 +129,7 @@ }, { "cell_type": "markdown", - "id": "e3823671", + "id": "0b584722", "metadata": {}, "source": [ "### Starting with an Empty Dictionary\n", @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2038366", + "id": "bb3d9302", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "c93e1566", + "id": "1ff93241", "metadata": {}, "source": [ "### Modifying Values in a Dictionary\n", @@ -164,7 +164,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9deb0533", + "id": "95c6ea14", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "c82be238", + "id": "d40f3d3c", "metadata": {}, "source": [ "For a more interesting example, let’s track the position of an alien that can move at different speeds. We’ll store a value representing the alien’s current speed and then use it to determine how far to the right the alien should move:" @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "709416b5", + "id": "a5a2986d", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "4a780d81", + "id": "57a1d076", "metadata": {}, "source": [ "### Removing Key-Value Pairs\n", @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "73d7348a", + "id": "93992cf7", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "2490bfb5", + "id": "e46ef404", "metadata": {}, "source": [ "### A Dictionary of Similar Objects\n", @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1390257", + "id": "0153aee6", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "a18054ab", + "id": "c21a8c75", "metadata": {}, "source": [ "To use this dictionary, given the name of a person who took the poll, you can easily look up their favorite language:" @@ -271,7 +271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "344e07b6", + "id": "4c6fe4fd", "metadata": {}, "outputs": [], "source": [ @@ -288,7 +288,7 @@ }, { "cell_type": "markdown", - "id": "2c3b026c", + "id": "53feb2d4", "metadata": {}, "source": [ "### Using get() to Access Values\n", @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b71cbc5", + "id": "4a958d9f", "metadata": {}, "outputs": [], "source": [ @@ -311,7 +311,7 @@ }, { "cell_type": "markdown", - "id": "dfc7332a", + "id": "468bc5a4", "metadata": {}, "source": [ "This results in a traceback, showing a KeyError:\n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70d5543b", + "id": "a802b785", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "6bae0b4a", + "id": "f2fe7f84", "metadata": {}, "source": [ "## LOOPING THROUGH A DICTIONARY\n", @@ -359,7 +359,7 @@ { "cell_type": "code", "execution_count": null, - "id": "433b8acd", + "id": "5c5139c1", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ }, { "cell_type": "markdown", - "id": "8dcee9a2", + "id": "2821ac87", "metadata": {}, "source": [ "You can access any single piece of information about user_0 based on what you’ve already learned in this chapter. But what if you wanted to see everything stored in this user’s dictionary? To do so, you could loop through the dictionary using a for loop:" @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a792798", + "id": "fa6953ce", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "0502b66e", + "id": "3fc15f3a", "metadata": {}, "source": [ "As shown above, to write a for loop for a dictionary, you create names for the two variables that will hold the key and value in each key-value pair. You can choose any names you want for these two variables. This code would work just as well if you had used abbreviations for the variable names, like this:\n", @@ -413,7 +413,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab8dc0ca", + "id": "d7c15e0e", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "8b2dc496", + "id": "70d514c0", "metadata": {}, "source": [ "Looping through the keys is actually the default behavior when looping through a dictionary, so this code would have exactly the same output if you wrote:\n", @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "822e4150", + "id": "37c63103", "metadata": {}, "outputs": [], "source": [ @@ -469,7 +469,7 @@ }, { "cell_type": "markdown", - "id": "293eab4e", + "id": "0dccee01", "metadata": {}, "source": [ "You can also use the keys() method to find out if a particular person was polled. This time, let’s find out if Erin took the poll:" @@ -478,7 +478,7 @@ { "cell_type": "code", "execution_count": null, - "id": "024bc6c0", + "id": "d1eceed4", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "5e5a1d4f", + "id": "89ac1ce5", "metadata": {}, "source": [ "### Looping Through a Dictionary’s Keys in a Particular Order\n", @@ -508,7 +508,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56537e39", + "id": "16a83c15", "metadata": {}, "outputs": [], "source": [ @@ -525,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "9267c0ba", + "id": "367c3ad1", "metadata": {}, "source": [ "### Looping Through All Values in a Dictionary\n", @@ -536,7 +536,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f308343a", + "id": "3949555b", "metadata": {}, "outputs": [], "source": [ @@ -554,7 +554,7 @@ }, { "cell_type": "markdown", - "id": "7dbdfd95", + "id": "2d5ed3cc", "metadata": {}, "source": [ "This approach pulls all the values from the dictionary without checking for repeats. That might work fine with a small number of values, but in a poll with a large number of respondents, this would result in a very repetitive list. To see each language chosen without repetition, we can use a set. A set is a collection in which each item must be unique:" @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89c02f14", + "id": "d3167ac3", "metadata": {}, "outputs": [], "source": [ @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "3af44876", + "id": "b2214678", "metadata": {}, "source": [ "When you wrap set() around a list that contains duplicate items, Python identifies the unique items in the list and builds a set from those items. We use set() to pull out the unique languages in favorite_languages.values().\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c4ef2f5", + "id": "06873f99", "metadata": {}, "outputs": [], "source": [ @@ -614,7 +614,7 @@ }, { "cell_type": "markdown", - "id": "0f7b870b", + "id": "60208da4", "metadata": {}, "source": [ "A more realistic example would involve more than three aliens with code that automatically generates each alien. In the following example we use range() to create a fleet of 30 aliens:" @@ -623,7 +623,7 @@ { "cell_type": "code", "execution_count": null, - "id": "77e22e54", + "id": "3d530234", "metadata": {}, "outputs": [], "source": [ @@ -645,7 +645,7 @@ }, { "cell_type": "markdown", - "id": "00e9723f", + "id": "43055ecb", "metadata": {}, "source": [ "It’s common to store a number of dictionaries in a list when each dictionary contains many kinds of information about one object. For example, you might create a dictionary for each user on a website. All of the dictionaries in the list should have an identical structure so you can loop through the list and work with each dictionary object in the same way.\n", @@ -660,7 +660,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47ecaf37", + "id": "dab610b8", "metadata": {}, "outputs": [], "source": [ @@ -680,7 +680,7 @@ }, { "cell_type": "markdown", - "id": "fb5d15d6", + "id": "633475ed", "metadata": {}, "source": [ "You can nest a list inside a dictionary any time you want more than one value to be associated with a single key in a dictionary. In the earlier example of favorite programming languages, if we were to store each person’s responses in a list, people could choose more than one favorite language. When we loop through the dictionary, the value associated with each person would be a list of languages rather than a single language. Inside the dictionary’s for loop, we use another for loop to run through the list of languages associated with each person:" @@ -689,7 +689,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61dbafd4", + "id": "2aa55f7e", "metadata": {}, "outputs": [], "source": [ @@ -708,7 +708,7 @@ }, { "cell_type": "markdown", - "id": "1c318e69", + "id": "7bbef344", "metadata": {}, "source": [ "### A Dictionary in a Dictionary\n", @@ -719,7 +719,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5089f56", + "id": "3c3bbee2", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "03ca6a66", + "id": "63866221", "metadata": {}, "source": [ "## SUMMARY\n", diff --git a/_sources/book/python/07_user_input_while_loops.ipynb b/_sources/book/python/07_user_input_while_loops.ipynb index 5a7f0b3..41ba13b 100644 --- a/_sources/book/python/07_user_input_while_loops.ipynb +++ b/_sources/book/python/07_user_input_while_loops.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "0cbe472a", + "id": "ed829a4a", "metadata": {}, "source": [ "# Looping\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f96b0750", + "id": "0e05da1b", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "markdown", - "id": "2647190b", + "id": "05b6318e", "metadata": {}, "source": [ "The input() function takes one argument: the prompt, or instructions, that we want to display to the user so they know what to do. In this example, when Python runs the first line, the user sees the prompt Tell me something, and I will repeat it back to you: . The program waits while the user enters their response and continues after the user presses ENTER. The response is assigned to the variable message, then print(message) displays the input back to the user:\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a90999b0", + "id": "41732987", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ }, { "cell_type": "markdown", - "id": "a5f966d7", + "id": "d7f0fde9", "metadata": {}, "source": [ "Sometimes you’ll want to write a prompt that’s longer than one line. For example, you might want to tell the user why you’re asking for certain input. You can assign your prompt to a variable and pass that variable to the input() function. This allows you to build your prompt over several lines, then write a clean input() statement." @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8af0bdf3", + "id": "bc505df4", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "ad1117c7", + "id": "95ad98d5", "metadata": {}, "source": [ "This example shows one way to build a multi-line string. The first line assigns the first part of the message to the variable prompt. In the second line, the operator += takes the string that was assigned to prompt and adds the new string onto the end.\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5eac7312", + "id": "ff7251cb", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "b26a3af7", + "id": "eeb892c2", "metadata": {}, "source": [ "The user enters the number 21, but when we ask Python for the value of age, it returns '21', the string representation of the numerical value entered. We know Python interpreted the input as a string because the number is now enclosed in quotes. If all you want to do is print the input, this works well. But if you try to use the input as a number, you’ll get an error. We can resolve this issue by using the int() function, which tells Python to treat the input as a numerical value. The int() function converts a string representation of a number to a numerical representation, as shown here:" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a9d6eb6", + "id": "b0649268", "metadata": {}, "outputs": [], "source": [ @@ -137,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "4439055e", + "id": "73afd91c", "metadata": {}, "source": [ "How do you use the int() function in an actual program? Consider a program that determines whether people are tall enough to ride a roller coaster:" @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "94d4dd32", + "id": "22a0f3c8", "metadata": {}, "outputs": [], "source": [ @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "89048ea4", + "id": "6a0ff349", "metadata": {}, "source": [ "## The Modulo Operator\n", @@ -172,7 +172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "262be433", + "id": "c6955878", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ { "cell_type": "code", "execution_count": null, - "id": "87fd250f", + "id": "01d85f05", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a3b9e25", + "id": "2431916c", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18cce6cd", + "id": "c8c63a98", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ }, { "cell_type": "markdown", - "id": "6c43c968", + "id": "752a2e87", "metadata": {}, "source": [ "The modulo operator doesn’t tell you how many times one number fits into another; it just tells you what the remainder is.\n", @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea5f0351", + "id": "b19be7e4", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "markdown", - "id": "7cdff798", + "id": "f5dd931f", "metadata": {}, "source": [ "## INTRODUCING WHILE LOOPS\n", @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "06a726a8", + "id": "3ca7a8d2", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "efc65c75", + "id": "70f59181", "metadata": {}, "source": [ "In the first line, we start counting from 1 by assigning current_number the value 1. The while loop is then set to keep running as long as the value of current_number is less than or equal to 5. The code inside the loop prints the value of current_number and then adds 1 to that value with current_number += 1. (The += operator is shorthand for current_number = current_number + 1.)\n", @@ -281,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f500096", + "id": "6b2d0d27", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "ce955741", + "id": "f65b605d", "metadata": {}, "source": [ "The first time through the loop, message is just an empty string, so Python enters the loop. At message = input(prompt), Python displays the prompt and waits for the user to enter their input. Whatever they enter is assigned to message and printed; then, Python reevaluates the condition in the while statement. As long as the user has not entered the word 'quit', the prompt is displayed again and Python waits for more input. When the user finally enters 'quit', Python stops executing the while loop and the program end.\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59ddaa6e", + "id": "f5562bdf", "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "markdown", - "id": "379fa1dd", + "id": "3f3e740d", "metadata": {}, "source": [ "## Using break to Exit a Loop\n", @@ -347,7 +347,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38229f73", + "id": "e8efc2ad", "metadata": {}, "outputs": [], "source": [ @@ -365,7 +365,7 @@ }, { "cell_type": "markdown", - "id": "4079de91", + "id": "4d75dcc2", "metadata": {}, "source": [ "A loop that starts with while True will run forever unless it reaches a break statement. The loop in this program continues asking the user to enter the names of cities they’ve been to until they enter 'quit'. When they enter 'quit', the break statement runs, causing Python to exit the loop.\n", @@ -378,7 +378,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37bd0770", + "id": "7dbcd1d6", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "82b13fc8", + "id": "3aa32c8f", "metadata": {}, "source": [ "## Avoiding Infinite Loops\n", @@ -404,7 +404,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b6890f63", + "id": "b381b72e", "metadata": {}, "outputs": [], "source": [ @@ -416,7 +416,7 @@ }, { "cell_type": "markdown", - "id": "4818036b", + "id": "54f2862c", "metadata": {}, "source": [ "But if you accidentally omit the line x += 1 (as shown next), the loop will run forever:" @@ -425,7 +425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "470f22a9", + "id": "4fca03dc", "metadata": {}, "outputs": [], "source": [ @@ -437,7 +437,7 @@ }, { "cell_type": "markdown", - "id": "28d1488c", + "id": "dcff3346", "metadata": {}, "source": [ "Every programmer accidentally writes an infinite while loop from time to time, especially when a program’s loops have subtle exit conditions. If your program gets stuck in an infinite loop, press CTRL-C or just close the terminal window displaying your program’s output.\n", @@ -458,7 +458,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17a6bce2", + "id": "46bfaf65", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +483,7 @@ }, { "cell_type": "markdown", - "id": "fec8a7ce", + "id": "68779830", "metadata": {}, "source": [ "## Removing All Instances of Specific Values from a List\n", @@ -496,7 +496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb17d38d", + "id": "cc304826", "metadata": {}, "outputs": [], "source": [ @@ -511,7 +511,7 @@ }, { "cell_type": "markdown", - "id": "2f17ca03", + "id": "03508629", "metadata": {}, "source": [ "## Filling a Dictionary with User Input\n", @@ -522,7 +522,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed1b5202", + "id": "a57a3543", "metadata": {}, "outputs": [], "source": [ @@ -552,7 +552,7 @@ }, { "cell_type": "markdown", - "id": "8faeda3e", + "id": "1bb357c7", "metadata": {}, "source": [ "## SUMMARY\n", diff --git a/_sources/book/python/08_functions.ipynb b/_sources/book/python/08_functions.ipynb index b686c04..6e56e3c 100644 --- a/_sources/book/python/08_functions.ipynb +++ b/_sources/book/python/08_functions.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "453b45ef", + "id": "d54f6e61", "metadata": {}, "source": [ "# Functions\n", @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "687b064a", + "id": "ad5ac1b3", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "markdown", - "id": "094172ca", + "id": "ade06630", "metadata": {}, "source": [ "### Passing Information to a Function\n", @@ -71,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ea9a9d37", + "id": "d9b3e0a4", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "d5a6d200", + "id": "5795451c", "metadata": {}, "source": [ "### Arguments and Parameters\n", @@ -107,7 +107,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ec1d5d5", + "id": "08b86672", "metadata": {}, "outputs": [], "source": [ @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "a6391b06", + "id": "fe492cb1", "metadata": {}, "source": [ "### Multiple Function Calls\n", @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5114f2af", + "id": "d97ac6e7", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "markdown", - "id": "a8dfa91f", + "id": "672d46d0", "metadata": {}, "source": [ "Calling a function multiple times is a very efficient way to work. The code describing a pet is written once in the function. Then, anytime you want to describe a new pet, you call the function with the new pet’s information. Even if the code for describing a pet were to expand to ten lines, you could still describe a new pet in just one line by calling the function again.\n", @@ -162,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2c4cfc9a", + "id": "46b81e63", "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "markdown", - "id": "94602795", + "id": "fa67ea11", "metadata": {}, "source": [ "In this function call we list the name first and the type of animal second. Because the argument 'harry' is listed first this time, that value is assigned to the parameter animal_type. Likewise, 'hamster' is assigned to pet_name. Now we have a “harry” named “Hamster”.\n", @@ -193,7 +193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0974e57c", + "id": "68c14f1a", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "58abf4ec", + "id": "24c8ec8d", "metadata": {}, "source": [ "The function describe_pet() hasn’t changed. But when we call the function, we explicitly tell Python which parameter each argument should be matched with. When Python reads the function call, it knows to assign the argument 'hamster' to the parameter animal_type and the argument 'harry' to pet_name. The output correctly shows that we have a hamster named Harry.\n", @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70a40c2e", + "id": "1d9e3217", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "880ae363", + "id": "957122cd", "metadata": {}, "source": [ "### Default Values\n", @@ -241,7 +241,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e80daaa", + "id": "aa4cb232", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ }, { "cell_type": "markdown", - "id": "088da846", + "id": "d941006b", "metadata": {}, "source": [ "We changed the definition of describe_pet() to include a default value, 'dog', for animal_type. Now when the function is called with no animal_type specified, Python knows to use the value 'dog' for this parameter.\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34b6969a", + "id": "b733584b", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "95de6a10", + "id": "e3a3b818", "metadata": {}, "source": [ "Because an explicit argument for animal_type is provided, Python will ignore the parameter’s default value.\n", @@ -298,7 +298,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9e15161", + "id": "3fbd8e9d", "metadata": {}, "outputs": [], "source": [ @@ -314,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "b176a685", + "id": "f999193e", "metadata": {}, "source": [ "### Avoiding Argument Errors\n", @@ -325,7 +325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1500431c", + "id": "a4b0a17d", "metadata": {}, "outputs": [], "source": [ @@ -339,7 +339,7 @@ }, { "cell_type": "markdown", - "id": "da19b79c", + "id": "b7549d5c", "metadata": {}, "source": [ "### RETURN VALUES \n", @@ -354,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2779025f", + "id": "18a88700", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "959baedb", + "id": "cdc2a241", "metadata": {}, "source": [ "### Making an Argument Optional\n", @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47faea1b", + "id": "f9bc5f1c", "metadata": {}, "outputs": [], "source": [ @@ -397,7 +397,7 @@ }, { "cell_type": "markdown", - "id": "1ef329bf", + "id": "574281f6", "metadata": {}, "source": [ "This function works when given a first, middle, and last name. The function takes in all three parts of a name and then builds a string out of them. The function adds spaces where appropriate and converts the full name to title case.\n", @@ -408,7 +408,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dec59725", + "id": "5637389b", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "4cd8059d", + "id": "63b9af26", "metadata": {}, "source": [ "### Returning a Dictionary\n", @@ -440,7 +440,7 @@ { "cell_type": "code", "execution_count": null, - "id": "613bf864", + "id": "0ea79c7a", "metadata": {}, "outputs": [], "source": [ @@ -455,7 +455,7 @@ }, { "cell_type": "markdown", - "id": "41c8a6fa", + "id": "c618a7c0", "metadata": {}, "source": [ "This function takes in simple textual information and puts it into a more meaningful data structure that lets you work with the information beyond just printing it. The strings 'jimi' and 'hendrix' are now labeled as a first name and last name. You can easily extend this function to accept optional values like a middle name, an age, an occupation, or any other information you want to store about a person. For example, the following change allows you to store a person’s age as well:" @@ -464,7 +464,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2508660", + "id": "cf0e386a", "metadata": {}, "outputs": [], "source": [ @@ -481,7 +481,7 @@ }, { "cell_type": "markdown", - "id": "b54e5efb", + "id": "932650f7", "metadata": {}, "source": [ "We add a new optional parameter age to the function definition and assign the parameter the special value None, which is used when a variable has no specific value assigned to it. You can think of None as a placeholder value. In conditional tests, None evaluates to False. If the function call includes a value for age, that value is stored in the dictionary. This function always stores a person’s name, but it can also be modified to store any other information you want about a person.\n", @@ -494,7 +494,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9cd9ad91", + "id": "8a9f8de3", "metadata": {}, "outputs": [], "source": [ @@ -522,7 +522,7 @@ }, { "cell_type": "markdown", - "id": "b7766659", + "id": "746c5332", "metadata": {}, "source": [ "### PASSING A LIST \n", @@ -535,7 +535,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22ee487a", + "id": "1ec1bc25", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +551,7 @@ }, { "cell_type": "markdown", - "id": "fba494b1", + "id": "cb9cc30d", "metadata": {}, "source": [ "### Modifying a List in a Function\n", @@ -564,7 +564,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93b9aa2a", + "id": "b14eb8ac", "metadata": {}, "outputs": [], "source": [ @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "5f336c1e", + "id": "c9a844a7", "metadata": {}, "source": [ "This program starts with a list of designs that need to be printed and an empty list called completed_models that each design will be moved to after it has been printed. As long as designs remain in unprinted_designs, the while loop simulates printing each design by removing a design from the end of the list, storing it in current_design, and displaying a message that the current design is being printed. It then adds the design to the list of completed models. When the loop is finished running, a list of the designs that have been printed is displayed.\n", @@ -598,7 +598,7 @@ { "cell_type": "code", "execution_count": null, - "id": "adc3abdf", + "id": "e2705758", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ }, { "cell_type": "markdown", - "id": "9af5b1f4", + "id": "558e8a87", "metadata": {}, "source": [ "We set up a list of unprinted designs and an empty list that will hold the completed models. Then, because we’ve already defined our two functions, all we have to do is call them and pass them the right arguments. We call print_models() and pass it the two lists it needs; as expected, print_models() simulates printing the designs. Then we call show_completed_models() and pass it the list of completed models so it can report the models that have been printed. The descriptive function names allow others to read this code and understand it, even without comments.\n", @@ -652,7 +652,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f331ae8", + "id": "e79ae542", "metadata": {}, "outputs": [], "source": [ @@ -680,7 +680,7 @@ }, { "cell_type": "markdown", - "id": "6b1c5717", + "id": "ca85b731", "metadata": {}, "source": [ "The function print_models() can do its work because it still receives the names of all unprinted designs. But this time it uses a copy of the original unprinted designs list, not the actual unprinted_designs list. The list completed_models will fill up with the names of printed models like it did before, but the original list of unprinted designs will be unaffected by the function.\n", @@ -697,7 +697,7 @@ { "cell_type": "code", "execution_count": null, - "id": "749ba72b", + "id": "375d67ac", "metadata": {}, "outputs": [], "source": [ @@ -711,7 +711,7 @@ }, { "cell_type": "markdown", - "id": "28c217a2", + "id": "1d6eeb18", "metadata": {}, "source": [ "The asterisk in the parameter name `*toppings` tells Python to make an empty tuple called toppings and pack whatever values it receives into this tuple. The print() call in the function body produces output showing that Python can handle a function call with one value and a call with three values. It treats the different calls similarly. Note that Python packs the arguments into a tuple, even if the function receives only one value.\n", @@ -722,7 +722,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93428a8f", + "id": "9ab32af9", "metadata": {}, "outputs": [], "source": [ @@ -738,7 +738,7 @@ }, { "cell_type": "markdown", - "id": "6a2d1ffc", + "id": "7f8626cb", "metadata": {}, "source": [ "### Mixing Positional and Arbitrary Arguments\n", @@ -751,7 +751,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc7171e8", + "id": "921fb100", "metadata": {}, "outputs": [], "source": [ @@ -767,7 +767,7 @@ }, { "cell_type": "markdown", - "id": "034ad537", + "id": "53814e1c", "metadata": {}, "source": [ "### Using Arbitrary Keyword Arguments\n", @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c11cd40", + "id": "aaaef2b2", "metadata": {}, "outputs": [], "source": [ @@ -796,7 +796,7 @@ }, { "cell_type": "markdown", - "id": "d3bd1bc3", + "id": "266c2321", "metadata": {}, "source": [ "The definition of build_profile() expects a first and last name, and then it allows the user to pass in as many name-value pairs as they want. The double asterisks before the parameter `**user_info` cause Python to create an empty dictionary called user_info and pack whatever name-value pairs it receives into this dictionary. Within the function, you can access the key-value pairs in user_info just as you would for any dictionary.\n", diff --git a/_sources/book/python/09_classes.ipynb b/_sources/book/python/09_classes.ipynb index c393f7c..92ae7a1 100644 --- a/_sources/book/python/09_classes.ipynb +++ b/_sources/book/python/09_classes.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "17b549b0", + "id": "15aa54f2", "metadata": {}, "source": [ "# Classes\n", @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2a6453f", + "id": "b5d1aed3", "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "5778dbdc", + "id": "4ab137c5", "metadata": {}, "source": [ "There’s a lot to notice here, but don’t worry. You’ll see this structure throughout this chapter and have lots of time to get used to it. At ➊ we define a class called Dog. By convention, capitalized names refer to classes in Python. There are no parentheses in the class definition because we’re creating this class from scratch. At ➋ we write a docstring describing what this class does.\n", @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85686fa6", + "id": "9f337636", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "4899ecd7", + "id": "42c8ba06", "metadata": {}, "source": [ "The Dog class we’re using here is the one we just wrote in the previous example. At ➊ we tell Python to create a dog whose name is 'Willie' and whose age is 6. When Python reads this line, it calls the `__init__()` method in Dog with the arguments 'Willie' and 6. The `__init__()` method creates an instance representing this particular dog and sets the name and age attributes using the values we provided. Python then returns an instance representing this dog. We assign that instance to the variable my_dog. The naming convention is helpful here: we can usually assume that a capitalized name like Dog refers to a class, and a lowercase name like my_dog refers to a single instance created from a class.\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd13a0fa", + "id": "46f9a5c5", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +131,7 @@ }, { "cell_type": "markdown", - "id": "e3fb0b42", + "id": "6ecc65a7", "metadata": {}, "source": [ "To call a method, give the name of the instance (in this case, my_dog) and the method you want to call, separated by a dot. When Python reads my_dog.sit(), it looks for the method sit() in the class Dog and runs that code. Python interprets the line my_dog.roll_over() in the same way.\n", @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "054dadbc", + "id": "54e6d084", "metadata": {}, "outputs": [], "source": [ @@ -164,7 +164,7 @@ }, { "cell_type": "markdown", - "id": "c31a6e2c", + "id": "7791b6ad", "metadata": {}, "source": [ "In this example we create a dog named Willie and a dog named Lucy. Each dog is a separate instance with its own set of attributes, capable of the same set of actions.\n", @@ -183,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d0416f62", + "id": "9a62ae5a", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "da339e33", + "id": "39e94ab7", "metadata": {}, "source": [ "### Setting a Default Value for an Attribute\n", @@ -220,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37389354", + "id": "80e5e024", "metadata": {}, "outputs": [], "source": [ @@ -250,7 +250,7 @@ }, { "cell_type": "markdown", - "id": "bf802d66", + "id": "5ae9ecbb", "metadata": {}, "source": [ "### Modifying Attribute Values\n", @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e571cb0", + "id": "4bab0f2a", "metadata": {}, "outputs": [], "source": [ @@ -277,7 +277,7 @@ }, { "cell_type": "markdown", - "id": "e3f6a0aa", + "id": "6bb20851", "metadata": {}, "source": [ "#### Modifying an Attribute’s Value Through a Method\n", @@ -288,7 +288,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a3a9d6b0", + "id": "27ab3f91", "metadata": {}, "outputs": [], "source": [ @@ -327,7 +327,7 @@ }, { "cell_type": "markdown", - "id": "5b80c4fa", + "id": "d60cc53f", "metadata": {}, "source": [ "We can extend the method update_odometer() to do additional work every time the odometer reading is modified. Let’s add a little logic to make sure no one tries to roll back the odometer reading:" @@ -336,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21383c99", + "id": "580e2b14", "metadata": {}, "outputs": [], "source": [ @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "946f4acb", + "id": "fbd58556", "metadata": {}, "source": [ "#### Incrementing an Attribute’s Value Through a Method\n", @@ -392,7 +392,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e325c2d7", + "id": "6ff0afb5", "metadata": {}, "outputs": [], "source": [ @@ -441,7 +441,7 @@ }, { "cell_type": "markdown", - "id": "798182a0", + "id": "85658c9a", "metadata": {}, "source": [ "## THE PYTHON STANDARD LIBRARY \n", @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bf494a43", + "id": "89f8775b", "metadata": {}, "outputs": [], "source": [ @@ -466,7 +466,7 @@ }, { "cell_type": "markdown", - "id": "399aba01", + "id": "caf69bbf", "metadata": {}, "source": [ "Another useful function is choice(). This function takes in a list or tuple and returns a randomly chosen element:" @@ -475,7 +475,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e483322", + "id": "b107ff0d", "metadata": {}, "outputs": [], "source": [ @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "ecd1dcb2", + "id": "7468fa2d", "metadata": {}, "source": [ "## STYLING CLASSES \n", diff --git a/_sources/book/python/10_files_and_exceptions.ipynb b/_sources/book/python/10_files_and_exceptions.ipynb index 94bfb04..6867a53 100644 --- a/_sources/book/python/10_files_and_exceptions.ipynb +++ b/_sources/book/python/10_files_and_exceptions.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5431d5f1", + "id": "9ba9e04d", "metadata": {}, "source": [ "# Files and Exceptions\n", @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bcfbbcd1", + "id": "ff1fb4d2", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "5e089caf", + "id": "5030c169", "metadata": {}, "source": [ "The first line of this program has a lot going on. Let’s start by looking at the open() function. To do any work with a file, even just printing its contents, you first need to open the file to access it. The open() function needs one argument: the name of the file you want to open. Python looks for this file in the directory where the program that’s currently being executed is stored. In this example, file_reader.py is currently running, so Python looks for pi_digits.txt in the directory where file_reader.py is stored. The open() function returns an object representing the file. Here, open('pi_digits.txt') returns an object representing pi_digits.txt. Python assigns this object to file_object, which we’ll work with later in the program.\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e191b93", + "id": "63fa1fc4", "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "d963180d", + "id": "1a9683a7", "metadata": {}, "source": [ "### File Paths\n", @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4c4088d", + "id": "47da508a", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "4f6e1b2d", + "id": "6c772c8a", "metadata": {}, "source": [ "```\n", @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bb74341", + "id": "be7c2d97", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "43a3368d", + "id": "5b255784", "metadata": {}, "source": [ "### Making a List of Lines from a File\n", @@ -185,7 +185,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f8c1d829", + "id": "d5f952ae", "metadata": {}, "outputs": [], "source": [ @@ -200,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "aab6f816", + "id": "5edf93ee", "metadata": {}, "source": [ "```\n", @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a67fbac", + "id": "3a20c828", "metadata": {}, "outputs": [], "source": [ @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "5c59f2f7", + "id": "f34a0d72", "metadata": {}, "source": [ "The variable pi_string contains the whitespace that was on the left side of the digits in each line, but we can get rid of that by using strip() instead of rstrip():" @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43da28c3", + "id": "7f6d570e", "metadata": {}, "outputs": [], "source": [ @@ -270,7 +270,7 @@ }, { "cell_type": "markdown", - "id": "433582c2", + "id": "6d572122", "metadata": {}, "source": [ "_Note: When Python reads from a text file, it interprets all text in the file as a string. If you read in a number and want to work with that value in a numerical context, you’ll have to convert it to an integer using the int() function or convert it to a float using the float() function._\n", @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9029c801", + "id": "bbb2a66c", "metadata": {}, "outputs": [], "source": [ @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "209ded41", + "id": "09495e6b", "metadata": {}, "source": [ "Python has no inherent limit to how much data you can work with; you can work with as much data as your system’s memory can handle.\n", @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b88adb5", + "id": "eb1810c7", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "417144cb", + "id": "fea1853e", "metadata": {}, "source": [ "## WRITING TO A FILE \n", @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2f8e648", + "id": "0f1008ba", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "af8278ff", + "id": "06e97d69", "metadata": {}, "source": [ "```\n", @@ -388,7 +388,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec7fa28f", + "id": "082b7fe0", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ }, { "cell_type": "markdown", - "id": "422b30b9", + "id": "9c1219f0", "metadata": {}, "source": [ "If you open programming.txt, you’ll see the two lines squished together:\n", @@ -416,7 +416,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8c02a351", + "id": "1a7f8b59", "metadata": {}, "outputs": [], "source": [ @@ -429,7 +429,7 @@ }, { "cell_type": "markdown", - "id": "15142ffb", + "id": "b8de9808", "metadata": {}, "source": [ "The output now appears on separate lines:\n", @@ -451,7 +451,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d472582b", + "id": "082175bb", "metadata": {}, "outputs": [], "source": [ @@ -464,7 +464,7 @@ }, { "cell_type": "markdown", - "id": "828a4fbb", + "id": "22809c36", "metadata": {}, "source": [ "## EXCEPTIONS \n", @@ -481,7 +481,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9476e23", + "id": "9ab67e17", "metadata": {}, "outputs": [], "source": [ @@ -490,7 +490,7 @@ }, { "cell_type": "markdown", - "id": "0a60fe82", + "id": "dabf5ed7", "metadata": {}, "source": [ "The error reported at ➊ in the traceback, ZeroDivisionError, is an exception object. Python creates this kind of object in response to a situation where it can’t do what we ask it to. When this happens, Python stops the program and tells us the kind of exception that was raised. We can use this information to modify our program. We’ll tell Python what to do when this kind of exception occurs; that way, if it happens again, we’re prepared.\n", @@ -505,7 +505,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2b4f07b9", + "id": "df6212f0", "metadata": {}, "outputs": [], "source": [ @@ -517,7 +517,7 @@ }, { "cell_type": "markdown", - "id": "c4759992", + "id": "7dbe4e3f", "metadata": {}, "source": [ "We put print(5/0), the line that caused the error, inside a try block. If the code in a try block works, Python skips over the except block. If the code in the try block causes an error, Python looks for an except block whose error matches the one that was raised and runs the code in that block.\n", @@ -540,7 +540,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ead19de", + "id": "f3c16580", "metadata": {}, "outputs": [], "source": [ @@ -564,7 +564,7 @@ }, { "cell_type": "markdown", - "id": "fcbc3e30", + "id": "f4b77358", "metadata": {}, "source": [ "The try-except-else block works like this: Python attempts to run the code in the try block. The only code that should go in a try block is code that might cause an exception to be raised. Sometimes you’ll have additional code that should run only if the try block was successful; this code goes in the else block. The except block tells Python what to do in case a certain exception arises when it tries to run the code in the try block. By anticipating likely sources of errors, you can write robust programs that continue to run even when they encounter invalid data and missing resources. Your code will be resistant to innocent user mistakes and malicious attacks.\n", @@ -579,7 +579,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e37fff8", + "id": "c255c663", "metadata": {}, "outputs": [], "source": [ @@ -591,7 +591,7 @@ }, { "cell_type": "markdown", - "id": "a80fe217", + "id": "a5381b82", "metadata": {}, "source": [ "There are two changes here. One is the use of the variable f to represent the file object, which is a common convention. The second is the use of the encoding argument. This argument is needed when your system’s default encoding doesn’t match the encoding of the file that’s being read.\n", @@ -604,7 +604,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fee64d02", + "id": "8658fb6e", "metadata": {}, "outputs": [], "source": [ @@ -619,7 +619,7 @@ }, { "cell_type": "markdown", - "id": "787c3dba", + "id": "1fe44613", "metadata": {}, "source": [ "### Analyzing Text\n", @@ -632,7 +632,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e1edf06", + "id": "b58d6cc9", "metadata": {}, "outputs": [], "source": [ @@ -642,7 +642,7 @@ }, { "cell_type": "markdown", - "id": "ea304083", + "id": "daf12b54", "metadata": {}, "source": [ "The split() method separates a string into parts wherever it finds a space and stores all the parts of the string in a list. The result is a list of words from the string, although some punctuation may also appear with some of the words. To count the number of words in Alice in Wonderland, we’ll use split() on the entire text. Then we’ll count the items in the list to get a rough idea of the number of words in the text:" @@ -651,7 +651,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ea9de59", + "id": "156efa12", "metadata": {}, "outputs": [], "source": [ @@ -671,7 +671,7 @@ }, { "cell_type": "markdown", - "id": "6992935d", + "id": "559d65d3", "metadata": {}, "source": [ "### Working with Multiple Files\n", @@ -682,7 +682,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dbb69ce", + "id": "afa62062", "metadata": {}, "outputs": [], "source": [ @@ -704,7 +704,7 @@ }, { "cell_type": "markdown", - "id": "28b3dcbe", + "id": "7d7e67ad", "metadata": {}, "source": [ "Now we can write a simple loop to count the words in any text we want to analyze. We do this by storing the names of the files we want to analyze in a list, and then we call count_words() for each file in the list. We’ll try to count the words for Alice in Wonderland, Siddhartha, Moby Dick, and Little Women, which are all available in the public domain. I’ve intentionally left siddhartha.txt out of the directory containing word_count.py, so we can see how well our program handles a missing file:" @@ -713,7 +713,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d66fc1fe", + "id": "330acc16", "metadata": {}, "outputs": [], "source": [ @@ -737,7 +737,7 @@ }, { "cell_type": "markdown", - "id": "0c67e7ee", + "id": "a9246a80", "metadata": {}, "source": [ "Using the try-except block in this example provides two significant advantages. We prevent our users from seeing a traceback, and we let the program continue analyzing the texts it’s able to find. If we don’t catch the FileNotFoundError that siddhartha.txt raised, the user would see a full traceback, and the program would stop running after trying to analyze Siddhartha. It would never analyze Moby Dick or Little Women.\n", @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ba8cbf2", + "id": "e49e6a4c", "metadata": {}, "outputs": [], "source": [ @@ -774,7 +774,7 @@ }, { "cell_type": "markdown", - "id": "0fb1b3bc", + "id": "fa6ac6f1", "metadata": {}, "source": [ "The pass statement also acts as a placeholder. It’s a reminder that you’re choosing to do nothing at a specific point in your program’s execution and that you might want to do something there later. For example, in this program we might decide to write any missing filenames to a file called missing_files.txt. Our users wouldn’t see this file, but we’d be able to read the file and deal with any missing texts.\n", @@ -801,7 +801,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64b82268", + "id": "819a9d9c", "metadata": {}, "outputs": [], "source": [ @@ -816,7 +816,7 @@ }, { "cell_type": "markdown", - "id": "e0e1f4c4", + "id": "b2673dd3", "metadata": {}, "source": [ "```\n", @@ -843,7 +843,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a69923c5", + "id": "9ee596f9", "metadata": {}, "outputs": [], "source": [ @@ -858,7 +858,7 @@ }, { "cell_type": "markdown", - "id": "fe55074d", + "id": "07bcb440", "metadata": {}, "source": [ "### Saving and Reading User-Generated Data\n", @@ -871,7 +871,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac7ed9fc", + "id": "05c40454", "metadata": {}, "outputs": [], "source": [ @@ -911,7 +911,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d56dd76e", + "id": "6dbfe046", "metadata": {}, "outputs": [], "source": [ @@ -920,7 +920,7 @@ }, { "cell_type": "markdown", - "id": "477212a1", + "id": "2bf3318b", "metadata": {}, "source": [ "Each function in this final version of remember_me.py has a single, clear purpose. We call greet_user(), and that function prints an appropriate message: it either welcomes back an existing user or greets a new user. It does this by calling get_stored_username(), which is responsible only for retrieving a stored username if one exists. Finally, greet_user() calls get_new_username() if necessary, which is responsible only for getting a new username and storing it. This compartmentalization of work is an essential part of writing clear code that will be easy to maintain and extend.\n", diff --git a/_sources/index.ipynb b/_sources/index.ipynb index 1eb236d..f753f6c 100644 --- a/_sources/index.ipynb +++ b/_sources/index.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d399a2f7", + "id": "7ef9bf0d", "metadata": {}, "source": [ "# Spatial Data Management\n", diff --git a/book/duckdb/01_duckdb_intro.html b/book/duckdb/01_duckdb_intro.html index 3fb4a47..e12eb16 100644 --- a/book/duckdb/01_duckdb_intro.html +++ b/book/duckdb/01_duckdb_intro.html @@ -201,16 +201,17 @@
  • 25. Data Import
  • 26. Data Export
  • 27. Working with Geometries
  • +
  • 28. Spatial Relationships
  • PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    PostGIS

    Labs

    -

    31.1. Connecting to the database#

    +

    32.1. Connecting to the database#

    %load_ext sql
    @@ -587,7 +588,7 @@ 

    31.1. Connecting to the database

    -

    31.2. Creating geometries#

    +

    32.2. Creating geometries#

    %%sql
    @@ -608,7 +609,7 @@ 

    31.2. Creating geometries -

    31.3. Metadata tables#

    +

    32.3. Metadata tables#

    %%sql 
    @@ -639,7 +640,7 @@ 

    31.3. Metadata tables -

    31.4. Points#

    +

    32.4. Points#

    A spatial point represents a single location on the Earth. This point is represented by a single coordinate (including either 2-, 3- or 4-dimensions). Points are used to represent objects when the exact details, such as shape and size, are not important at the target scale. For example, cities on a map of the world can be described as points, while a map of a single state might represent cities as polygons.

    @@ -683,7 +684,7 @@

    31.4. Points -

    31.5. Linestrings#

    +

    32.5. Linestrings#

    A linestring is a path between locations. It takes the form of an ordered series of two or more points. Roads and rivers are typically @@ -730,7 +731,7 @@

    31.5. Linestrings

    -

    31.6. Polygons#

    +

    32.6. Polygons#

    A polygon is a representation of an area. The outer boundary of the polygon is represented by a ring. This ring is a linestring that is both @@ -778,7 +779,7 @@

    31.6. Polygons

    -

    31.7. Collections#

    +

    32.7. Collections#

    There are four collection types, which group multiple simple geometries into sets.

    -

    31.8. Geometry Input and Output#

    +

    32.8. Geometry Input and Output#

    Within the database, geometries are stored on disk in a format only used by the PostGIS program. In order for external programs to insert and retrieve useful geometries, they need to be converted into a format that @@ -886,7 +887,7 @@

    31.8. Geometry Input and Output

    -

    31.9. Casting from Text#

    +

    32.9. Casting from Text#

    The WKT strings we’ve see so far have been of type ‘text’ and we have been converting them to type ‘geometry’ using PostGIS functions like ST_GeomFromText().

    @@ -925,7 +926,7 @@

    31.9. Casting from Text -

    31.10. Function List#

    +

    32.10. Function List#

    ST_Area: Returns the area of the surface if it is a polygon or multi-polygon. For “geometry” type area is in SRID units. For “geography” area is in square meters.

    @@ -1006,7 +1007,7 @@

    31.10. Function List

    previous

    -

    30. Introduction to PostGIS

    +

    31. Introduction to PostGIS

    31.10. Function List

    next

    -

    32. Spatial Relationships

    +

    33. Spatial Relationships

    @@ -1033,16 +1034,16 @@

    31.10. Function List diff --git a/book/postgis/geopandas.html b/book/postgis/geopandas.html index 04e1cbd..8f4f923 100644 --- a/book/postgis/geopandas.html +++ b/book/postgis/geopandas.html @@ -9,7 +9,7 @@ - 34. Using GeoPandas — Spatial Data Management with Earth Engine + 35. Using GeoPandas — Spatial Data Management with Earth Engine @@ -68,7 +68,7 @@ - + @@ -201,16 +201,17 @@
  • 25. Data Import
  • 26. Data Export
  • 27. Working with Geometries
  • +
  • 28. Spatial Relationships
  • PostGIS

    Labs

    -

    34.1. Connecting to the database#

    +

    35.1. Connecting to the database#

    import os
    @@ -588,7 +589,7 @@ 

    34.1. Connecting to the database

    -

    34.2. Reading data from PostGIS#

    +

    35.2. Reading data from PostGIS#

    import geopandas as gpd
    @@ -626,7 +627,7 @@ 

    34.2. Reading data from PostGIS

    -

    34.3. Writing files#

    +

    35.3. Writing files#

    out_dir = os.path.expanduser('~/Downloads')
    @@ -661,7 +662,7 @@ 

    34.3. Writing files

    -

    34.4. Measuring area#

    +

    35.4. Measuring area#

    gdf = gdf.set_index("name")
    @@ -679,7 +680,7 @@ 

    34.4. Measuring area -

    34.5. Getting polygon bounary#

    +

    35.5. Getting polygon bounary#

    gdf['boundary'] = gdf.boundary
    @@ -690,7 +691,7 @@ 

    34.5. Getting polygon bounary -

    34.6. Getting polygon centroid#

    +

    35.6. Getting polygon centroid#

    gdf['centroid'] = gdf.centroid
    @@ -701,7 +702,7 @@ 

    34.6. Getting polygon centroid -

    34.7. Making maps#

    +

    35.7. Making maps#

    gdf.plot()
    @@ -741,7 +742,7 @@ 

    34.7. Making maps

    -

    34.8. Reprojecting data#

    +

    35.8. Reprojecting data#

    sql = 'SELECT * FROM nyc_neighborhoods'
    @@ -779,7 +780,7 @@ 

    34.8. Reprojecting data -

    34.9. Displaying data on an interative map#

    +

    35.9. Displaying data on an interative map#

    diff --git a/book/postgis/installation.html b/book/postgis/installation.html index 57904ac..9bd25b0 100644 --- a/book/postgis/installation.html +++ b/book/postgis/installation.html @@ -9,7 +9,7 @@ - 28. Installation — Spatial Data Management with Earth Engine + 29. Installation — Spatial Data Management with Earth Engine @@ -67,8 +67,8 @@ - - + + @@ -201,16 +201,17 @@
  • 25. Data Import
  • 26. Data Export
  • 27. Working with Geometries
  • +
  • 28. Spatial Relationships
  • PostGIS

    Labs

    @@ -512,7 +513,7 @@

    Contents

    -

    28. Installation#

    +

    29. Installation#

    Setting up the conda env:

    conda create -n sql python
     conda activate sql
    @@ -524,7 +525,7 @@ 

    28. Installation

    cities.csv

    -

    28.1. Using ipython-sql#

    +

    29.1. Using ipython-sql#

    %load_ext sql
    @@ -583,7 +584,7 @@ 

    28.1. Using ipython-sql -

    28.2. Using sqlalchemy#

    +

    29.2. Using sqlalchemy#

    diff --git a/book/postgis/postgis_intro.html b/book/postgis/postgis_intro.html index 38b12e9..b325f88 100644 --- a/book/postgis/postgis_intro.html +++ b/book/postgis/postgis_intro.html @@ -9,7 +9,7 @@ - 30. Introduction to PostGIS — Spatial Data Management with Earth Engine + 31. Introduction to PostGIS — Spatial Data Management with Earth Engine @@ -67,8 +67,8 @@ - - + + @@ -201,16 +201,17 @@
  • 25. Data Import
  • 26. Data Export
  • 27. Working with Geometries
  • +
  • 28. Spatial Relationships
  • PostGIS

    Labs