Add initial version of chapter 05's summary
This commit is contained in:
parent
586941fdba
commit
50aa180462
2 changed files with 86 additions and 0 deletions
85
05_numbers/04_summary.ipynb
Normal file
85
05_numbers/04_summary.ipynb
Normal file
|
@ -0,0 +1,85 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"slideshow": {
|
||||
"slide_type": "slide"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"# Chapter 5: Numbers & Bits (TL;DR)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"slideshow": {
|
||||
"slide_type": "skip"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"There exist three numeric types in core Python:\n",
|
||||
"- `int`: a near-perfect model for whole numbers (i.e., $\\mathbb{Z}$); inherently precise\n",
|
||||
"- `float`: the \"gold\" standard to approximate real numbers (i.e., $\\mathbb{R}$); inherently imprecise\n",
|
||||
"- `complex`: layer on top of the `float` type to approximate complex numbers (i.e., $\\mathbb{C}$); inherently imprecise\n",
|
||||
"\n",
|
||||
"Furthermore, the [standard library <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://docs.python.org/3/library/index.html) provides two more types that can be used as substitutes for the `float` type:\n",
|
||||
"- `Decimal`: similar to `float` but allows customizing the precision; still inherently imprecise\n",
|
||||
"- `Fraction`: a near-perfect model for rational numbers (i.e., $\\mathbb{Q}$); built on top of the `int` type and therefore inherently precise\n",
|
||||
"\n",
|
||||
"The *important* takeaways for the data science practitioner are:\n",
|
||||
"\n",
|
||||
"1. **Do not mix** precise and imprecise data types, and\n",
|
||||
"2. actively expect `nan` results when working with `float` numbers as there are no **loud failures**.\n",
|
||||
"\n",
|
||||
"The **numerical tower** is Python's way of implementing various **abstract** ideas of what numbers are in mathematics."
|
||||
]
|
||||
}
|
||||
],
|
||||
"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
|
||||
}
|
|
@ -136,6 +136,7 @@ Alternatively, the content can be viewed in a web browser
|
|||
[<img height="12" style="display: inline-block" src="static/link/to_mb.png">](https://mybinder.org/v2/gh/webartifex/intro-to-python/develop?urlpath=lab/tree/05_numbers/03_appendix.ipynb)
|
||||
(`Decimal` Type;
|
||||
`Fraction` Type)
|
||||
- [summary <img height="12" style="display: inline-block" src="static/link/to_nb.png">](https://nbviewer.jupyter.org/github/webartifex/intro-to-python/blob/develop/05_numbers/04_summary.ipynb)
|
||||
|
||||
|
||||
#### Videos
|
||||
|
|
Loading…
Reference in a new issue