2020-03-06 18:19:03 +00:00
|
|
|
{
|
|
|
|
"cells": [
|
2020-09-03 22:51:00 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"#hide\n",
|
2020-11-29 18:40:59 +00:00
|
|
|
"!pip install -Uqq fastbook\n",
|
2020-09-03 22:51:00 +00:00
|
|
|
"import fastbook\n",
|
|
|
|
"fastbook.setup_book()"
|
|
|
|
]
|
|
|
|
},
|
2020-09-03 23:50:15 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"from fastbook import *"
|
|
|
|
]
|
|
|
|
},
|
2020-03-06 18:19:03 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2020-04-21 12:19:15 +00:00
|
|
|
"# Appendix: Jupyter Notebook 101"
|
2020-03-06 18:19:03 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Introduction"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
2020-09-03 22:58:27 +00:00
|
|
|
"outputs": [],
|
2020-03-06 18:19:03 +00:00
|
|
|
"source": [
|
|
|
|
"1+1"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Writing"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
2020-09-03 22:58:27 +00:00
|
|
|
"outputs": [],
|
2020-03-06 18:19:03 +00:00
|
|
|
"source": [
|
|
|
|
"3/2"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Modes"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Other Important Considerations"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2020-04-21 12:19:15 +00:00
|
|
|
"## Markdown Formatting\n"
|
2020-03-06 18:19:03 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Italics, Bold, Strikethrough, Inline, Blockquotes and Links"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Headings"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Lists"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Code Capabilities"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# Import necessary libraries\n",
|
2020-08-21 19:36:27 +00:00
|
|
|
"from fastai.vision.all import * \n",
|
2020-03-06 18:19:03 +00:00
|
|
|
"import matplotlib.pyplot as plt"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"from PIL import Image"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
2020-09-03 22:58:27 +00:00
|
|
|
"outputs": [],
|
2020-03-06 18:19:03 +00:00
|
|
|
"source": [
|
|
|
|
"a = 1\n",
|
|
|
|
"b = a + 1\n",
|
|
|
|
"c = b + a + 1\n",
|
|
|
|
"d = c + b + a + 1\n",
|
|
|
|
"a, b, c ,d"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
2020-09-03 22:58:27 +00:00
|
|
|
"outputs": [],
|
2020-03-06 18:19:03 +00:00
|
|
|
"source": [
|
|
|
|
"plt.plot([a,b,c,d])\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
2020-09-03 22:58:27 +00:00
|
|
|
"outputs": [],
|
2020-03-06 18:19:03 +00:00
|
|
|
"source": [
|
2020-09-03 23:50:15 +00:00
|
|
|
"Image.open(image_cat())"
|
2020-03-06 18:19:03 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2020-04-21 12:19:15 +00:00
|
|
|
"## Running the App Locally"
|
2020-03-06 18:19:03 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2020-04-21 12:19:15 +00:00
|
|
|
"## Creating a Notebook"
|
2020-03-06 18:19:03 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2020-04-21 12:19:15 +00:00
|
|
|
"## Shortcuts and Tricks"
|
2020-03-06 18:19:03 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Command Mode Shortcuts"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Cell Tricks"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Line Magics"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
2020-09-03 22:58:27 +00:00
|
|
|
"outputs": [],
|
2020-03-06 18:19:03 +00:00
|
|
|
"source": [
|
|
|
|
"%timeit [i+1 for i in range(1000)]"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "Python 3",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|