{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "
\n",
"
"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"# GIS\n",
"Geoinformation systems\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"[](https://mybinder.org/v2/gh/das-g/comprehensions-talk/master)\n",
"Follow along on\n",
"\n",
"https://mybinder.org/v2/gh/das-g/comprehensions-talk\n",
"\n",
"# Comprehensions"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"inspired by (and partially ripped off of)\n",
"\n",
"### From List Comprehensions to Generator Expressions\n",
"by Guido van Rossum [on \"The History of Python\"](http://python-history.blogspot.ch/2010/06/from-list-comprehensions-to-generator.html)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## List Comprehensions ([PEP 202](https://www.python.org/dev/peps/pep-0202/))\n",
"\n",
"* since **Python 2.0** (2000-10-16)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "notes"
}
},
"source": [
"Date in parentheses is the release date.\n",
"\n",
"Source:\n",
"* [Python 2.0](https://www.python.org/download/releases/2.0/) Release"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"> \"[...] a Pythonic interpretation of a well-known notation for sets used by mathematicians.\""
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"$${\\large\n",
" \\left\\{ x \\,\\middle|\\, x > 10 \\right\\}\n",
"}$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"> \"set of all $x$ such that $x > 10$\""
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Set notations in math\n",
"\n",
"Set of square numbers
\n", "