From eda9266a79774541da834260ef35a1b7d0474b9a Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Mon, 19 Oct 2020 20:01:04 +0200 Subject: [PATCH] Add initial version of chapter 07's summary --- 07_sequences/06_summary.ipynb | 85 +++++++++++++++++++++++++++++++++++ CONTENTS.md | 3 +- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 07_sequences/06_summary.ipynb diff --git a/07_sequences/06_summary.ipynb b/07_sequences/06_summary.ipynb new file mode 100644 index 0000000..8115139 --- /dev/null +++ b/07_sequences/06_summary.ipynb @@ -0,0 +1,85 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Chapter 7: Sequential Data (TL;DR)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "skip" + } + }, + "source": [ + "**Sequences** are an *abstract* concept that summarizes *four* behaviors an object may or may not exhibit. Sequences are\n", + "- **finite** and\n", + "- **ordered**\n", + "- **containers** that we may\n", + "- **loop over**.\n", + "\n", + "Examples are the `list`, `tuple`, but also the `str` types.\n", + "\n", + "Objects that exhibit all behaviors *except* being ordered are referred to as **collections**.\n", + "\n", + "The objects inside a sequence are called its **elements** and may be labeled with a unique **index**, an `int` object in the range $0 \\leq \\text{index} < \\lvert \\text{sequence} \\rvert$.\n", + "\n", + "`list` objects are **mutable**. That means we can change the references to the other objects it contains, and, in particular, re-assign them.\n", + "\n", + "On the contrary, `tuple` objects are like **immutable** lists: We can use them in place of any `list` object as long as we do *not* need to mutate it. Often, `tuple` objects are also used to model **records** of related **fields**." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.6" + }, + "livereveal": { + "auto_select": "code", + "auto_select_fragment": true, + "scroll": true, + "theme": "serif" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": false, + "sideBar": true, + "skip_h1_title": true, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": { + "height": "calc(100% - 180px)", + "left": "10px", + "top": "150px", + "width": "384px" + }, + "toc_section_display": false, + "toc_window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/CONTENTS.md b/CONTENTS.md index bb9df6c..ac2e795 100644 --- a/CONTENTS.md +++ b/CONTENTS.md @@ -186,4 +186,5 @@ If this is not possible, (Packing & Unpacking with Functions) - [appendix ](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/07_sequences/05_appendix.ipynb) [](https://mybinder.org/v2/gh/webartifex/intro-to-python/develop?urlpath=lab/tree/07_sequences/05_appendix.ipynb) - (`namedtuple` Type) \ No newline at end of file + (`namedtuple` Type) + - [summary ](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/07_sequences/06_summary.ipynb) \ No newline at end of file