|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "raw",
|
5 |
| - "id": "7ba3eb4e", |
| 5 | + "id": "7f21c02b", |
6 | 6 | "metadata": {
|
7 | 7 | "raw_mimetype": "text/restructuredtext"
|
8 | 8 | },
|
|
14 | 14 | },
|
15 | 15 | {
|
16 | 16 | "cell_type": "markdown",
|
17 |
| - "id": "f85e281b", |
| 17 | + "id": "e0ac6fc5", |
18 | 18 | "metadata": {},
|
19 | 19 | "source": [
|
20 | 20 | "# Jupyter Notebooks\n",
|
21 | 21 | "\n",
|
22 |
| - "<div class=\"alert alert-warning\">\n", |
23 |
| - "\n", |
24 |
| - "**Before You Start This Section**: \n", |
25 |
| - "\n", |
26 |
| - "In the following section we will be using IPython or a Jupyter notebook to run our code.\n", |
27 |
| - "Presently, there is an incompatibility with these programs and a Python package called `jedi`, which typically is responsible for performing auto-completions in our code (when prompted by hitting `<TAB>`, which we will be doing below).\n", |
28 |
| - "It is really useful!\n", |
29 |
| - "\n", |
30 |
| - "First, let's check to see if we have an incompatible version of `jedi` installed.\n", |
31 |
| - "In your terminal (before starting a Python/IPython/Jupyter session), run\n", |
32 |
| - " \n", |
33 |
| - "```\n", |
34 |
| - "conda list\n", |
35 |
| - "```\n", |
36 |
| - "\n", |
37 |
| - "And look for the line that starts with `jedi`\n", |
38 |
| - " \n", |
39 |
| - "```\n", |
40 |
| - "jedi 0.18.0\n", |
41 |
| - "```\n", |
42 |
| - "\n", |
43 |
| - "If you see that you have version `0.18.0` installed (as above), then you will want to downgrade it.\n", |
44 |
| - "In the same terminal, run the following command\n", |
45 |
| - "\n", |
46 |
| - "```\n", |
47 |
| - "conda install jedi=0.17.2\n", |
48 |
| - "```\n", |
49 |
| - "You should be all set once you have followed the prompts and the installation has completed!\n", |
50 |
| - " \n", |
51 |
| - "Note that you will need to repeat this process if you [create a new conda environment](https://www.pythonlikeyoumeanit.com/Module1_GettingStartedWithPython/Installing_Python.html#A-Brief-Introduction-to-Conda-Environments) with IPython/Jupter installed in it.\n", |
52 |
| - "</div>\n", |
53 |
| - "\n", |
54 | 22 | "In recent years, the Jupyter Notebook has become a massively popular tool for doing research-oriented work in Python and other languages alike.\n",
|
55 | 23 | "Its emergence marked a paradigm shift in the way data science is conducted. \n",
|
56 | 24 | "\n",
|
|
69 | 37 | },
|
70 | 38 | {
|
71 | 39 | "cell_type": "markdown",
|
72 |
| - "id": "85753bea", |
| 40 | + "id": "309812cd", |
73 | 41 | "metadata": {},
|
74 | 42 | "source": [
|
75 | 43 | "The following instructions are laid out for running a Jupyter notebook server. That being said, the process for running a Jupyter lab server and working with notebooks therein is nearly identical.\n",
|
|
78 | 46 | },
|
79 | 47 | {
|
80 | 48 | "cell_type": "markdown",
|
81 |
| - "id": "c7625997", |
| 49 | + "id": "94e10d80", |
82 | 50 | "metadata": {},
|
83 | 51 | "source": [
|
84 | 52 | "## Running a Notebook Server & Creating a Notebook\n",
|
|
101 | 69 | },
|
102 | 70 | {
|
103 | 71 | "cell_type": "markdown",
|
104 |
| - "id": "4c3c2b57", |
| 72 | + "id": "8a692905", |
105 | 73 | "metadata": {},
|
106 | 74 | "source": [
|
107 | 75 | "You can use this to enter subdirectories and to open up any Jupyter notebooks that you have saved. *You will need to use this file explorer any time that you want to open up a Jupyter notebook, old or new.* In the top-right corner of this window, click on the dropdown menu labeled \"New\", and select the option `Python 3`.\n",
|
|
122 | 90 | },
|
123 | 91 | {
|
124 | 92 | "cell_type": "markdown",
|
125 |
| - "id": "f3a1d63e", |
| 93 | + "id": "0b9dba08", |
126 | 94 | "metadata": {},
|
127 | 95 | "source": [
|
128 | 96 | "## Notebook Cells \n",
|
|
150 | 118 | },
|
151 | 119 | {
|
152 | 120 | "cell_type": "markdown",
|
153 |
| - "id": "525ceb01", |
| 121 | + "id": "806a3373", |
154 | 122 | "metadata": {},
|
155 | 123 | "source": [
|
156 | 124 | "## An Example Notebook\n",
|
|
160 | 128 | {
|
161 | 129 | "cell_type": "code",
|
162 | 130 | "execution_count": 1,
|
163 |
| - "id": "5536be6d", |
| 131 | + "id": "006adf4f", |
164 | 132 | "metadata": {
|
165 | 133 | "execution": {
|
166 |
| - "iopub.execute_input": "2022-01-30T01:35:47.187863Z", |
167 |
| - "iopub.status.busy": "2022-01-30T01:35:47.186868Z", |
168 |
| - "iopub.status.idle": "2022-01-30T01:35:48.913556Z", |
169 |
| - "shell.execute_reply": "2022-01-30T01:35:48.915556Z" |
| 134 | + "iopub.execute_input": "2022-01-31T16:03:49.808358Z", |
| 135 | + "iopub.status.busy": "2022-01-31T16:03:49.804349Z", |
| 136 | + "iopub.status.idle": "2022-01-31T16:03:51.852436Z", |
| 137 | + "shell.execute_reply": "2022-01-31T16:03:51.854425Z" |
170 | 138 | }
|
171 | 139 | },
|
172 | 140 | "outputs": [],
|
|
181 | 149 | {
|
182 | 150 | "cell_type": "code",
|
183 | 151 | "execution_count": 2,
|
184 |
| - "id": "e0e04672", |
| 152 | + "id": "a4b3cf3e", |
185 | 153 | "metadata": {
|
186 | 154 | "execution": {
|
187 |
| - "iopub.execute_input": "2022-01-30T01:35:48.922559Z", |
188 |
| - "iopub.status.busy": "2022-01-30T01:35:48.921555Z", |
189 |
| - "iopub.status.idle": "2022-01-30T01:35:48.929555Z", |
190 |
| - "shell.execute_reply": "2022-01-30T01:35:48.930554Z" |
| 155 | + "iopub.execute_input": "2022-01-31T16:03:51.868423Z", |
| 156 | + "iopub.status.busy": "2022-01-31T16:03:51.863428Z", |
| 157 | + "iopub.status.idle": "2022-01-31T16:03:51.885429Z", |
| 158 | + "shell.execute_reply": "2022-01-31T16:03:51.883432Z" |
191 | 159 | }
|
192 | 160 | },
|
193 | 161 | "outputs": [],
|
|
203 | 171 | {
|
204 | 172 | "cell_type": "code",
|
205 | 173 | "execution_count": 3,
|
206 |
| - "id": "b5e62463", |
| 174 | + "id": "f994c54c", |
207 | 175 | "metadata": {
|
208 | 176 | "execution": {
|
209 |
| - "iopub.execute_input": "2022-01-30T01:35:48.938562Z", |
210 |
| - "iopub.status.busy": "2022-01-30T01:35:48.937560Z", |
211 |
| - "iopub.status.idle": "2022-01-30T01:35:48.944560Z", |
212 |
| - "shell.execute_reply": "2022-01-30T01:35:48.944560Z" |
| 177 | + "iopub.execute_input": "2022-01-31T16:03:51.895427Z", |
| 178 | + "iopub.status.busy": "2022-01-31T16:03:51.893435Z", |
| 179 | + "iopub.status.idle": "2022-01-31T16:03:51.897427Z", |
| 180 | + "shell.execute_reply": "2022-01-31T16:03:51.897427Z" |
213 | 181 | }
|
214 | 182 | },
|
215 | 183 | "outputs": [],
|
|
223 | 191 | {
|
224 | 192 | "cell_type": "code",
|
225 | 193 | "execution_count": 4,
|
226 |
| - "id": "7b37f572", |
| 194 | + "id": "35ec7d50", |
227 | 195 | "metadata": {
|
228 | 196 | "execution": {
|
229 |
| - "iopub.execute_input": "2022-01-30T01:35:48.962553Z", |
230 |
| - "iopub.status.busy": "2022-01-30T01:35:48.961558Z", |
231 |
| - "iopub.status.idle": "2022-01-30T01:35:49.703435Z", |
232 |
| - "shell.execute_reply": "2022-01-30T01:35:49.704435Z" |
| 197 | + "iopub.execute_input": "2022-01-31T16:03:51.904426Z", |
| 198 | + "iopub.status.busy": "2022-01-31T16:03:51.903431Z", |
| 199 | + "iopub.status.idle": "2022-01-31T16:03:52.704903Z", |
| 200 | + "shell.execute_reply": "2022-01-31T16:03:52.704903Z" |
233 | 201 | }
|
234 | 202 | },
|
235 | 203 | "outputs": [
|
|
262 | 230 | },
|
263 | 231 | {
|
264 | 232 | "cell_type": "markdown",
|
265 |
| - "id": "ecc9417e", |
| 233 | + "id": "1fcd4387", |
266 | 234 | "metadata": {},
|
267 | 235 | "source": [
|
268 | 236 | "Notice that this notebook interface is great for making adjustments to this plot. You can easily change the color or line-style of the plot and redraw it without having to recompute the functions. You simply re-execute the cell containing the plot code. This is especially nice when the numerical computations required to generate the curves are costly."
|
269 | 237 | ]
|
270 | 238 | },
|
271 | 239 | {
|
272 | 240 | "cell_type": "markdown",
|
273 |
| - "id": "5789a537", |
| 241 | + "id": "3bc56d7f", |
274 | 242 | "metadata": {},
|
275 | 243 | "source": [
|
276 | 244 | "## Familiarizing Yourself with Jupyter Notebooks\n",
|
|
312 | 280 | },
|
313 | 281 | {
|
314 | 282 | "cell_type": "markdown",
|
315 |
| - "id": "9eba658f", |
| 283 | + "id": "fe2cc7f9", |
316 | 284 | "metadata": {},
|
317 | 285 | "source": [
|
318 | 286 | "### Using Jupyter Notebooks with Other Languages\n",
|
|
0 commit comments