Skip to content

Commit e3ba87e

Browse files
committed
show Jupyter before explaining it
1 parent 21b1c6e commit e3ba87e

File tree

2 files changed

+88
-43
lines changed

2 files changed

+88
-43
lines changed

assignments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This error can happen if you tried to output a lot of data in tables/charts. Ste
153153
If you're confused by these instrucions, download the notebook file and [email to the instructor](syllabus.md#instructor-information).
154154
{%- endif %}
155155

156-
### {{coding_env_kernel_name}} and memory issues
156+
### {{coding_env_kernel_name|title}} and memory issues
157157

158158
The {{coding_env_kernel_name}} is [the place where Python is installed and the code is actually executing](https://docs.jupyter.org/en/stable/projects/kernels.html#kernels), in the cloud somewhere.
159159

lecture_0.ipynb

Lines changed: 87 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -546,81 +546,91 @@
546546
{
547547
"cell_type": "markdown",
548548
"metadata": {
549+
"editable": true,
549550
"slideshow": {
550551
"slide_type": "slide"
551-
}
552+
},
553+
"tags": []
552554
},
553555
"source": [
554556
"## Jupyter\n",
555557
"\n",
556-
"- Web based programming environment\n",
557-
"- Supports Python by default, and other languages with plugins\n",
558-
"- Nicely displays output of your code so you can check and share the results\n",
559-
"- Avoids using the command line\n",
560-
"- Avoids installation problems across different computers and operating systems"
558+
"1. Go to [{{coding_env_name}}]({{coding_env_url}})\n",
559+
"1. Create a notebook.{% if id == \"nyu\" %}\n",
560+
" 1. Click `New`\n",
561+
" 1. Click `Notebook`\n",
562+
" 1. When it asks you to `Select Kernel`, choose `Python [conda env:python-public-policy]`\n",
563+
"{%- endif %}\n",
564+
"1. Paste in [the following example](https://plotly.com/python/linear-fits/#linear-fit-trendlines-with-plotly-express).\n",
565+
"1. Press the ▶️ button (or `Control`+`Enter` on your keyboard).\n",
566+
"\n",
567+
"```python\n",
568+
"import plotly.express as px\n",
569+
"\n",
570+
"df = px.data.tips()\n",
571+
"fig = px.scatter(df, x=\"total_bill\", y=\"tip\", trendline=\"ols\")\n",
572+
"fig.show()\n",
573+
"``` "
561574
]
562575
},
563576
{
564577
"cell_type": "markdown",
565578
"metadata": {
566-
"tags": [
567-
"nyu-only"
568-
]
579+
"editable": true,
580+
"slideshow": {
581+
"slide_type": "subslide"
582+
},
583+
"tags": []
569584
},
570585
"source": [
571-
"We're using [JupyterHub](https://jupyter.org/hub), [offered by NYU's High Performance Computing (HPC) group](https://sites.google.com/nyu.edu/nyu-hpc/training-support/resources-for-classes/jupyterhub)."
586+
"FYI `px.data.tips()` loads one of [Plotly's sample datasets](https://plotly.com/python-api-reference/generated/plotly.express.data.html). You don't need that when plotting other datasets."
572587
]
573588
},
574589
{
575590
"cell_type": "markdown",
576591
"metadata": {
577-
"tags": [
578-
"columbia-only"
579-
]
592+
"editable": true,
593+
"slideshow": {
594+
"slide_type": "subslide"
595+
},
596+
"tags": []
580597
},
581598
"source": [
582-
"We're using a service called [{{coding_env_name}}]({{coding_env_url}}) for their Jupyter functionality."
599+
"- Web based programming environment\n",
600+
"- Supports Python by default, and other languages with plugins\n",
601+
"- Nicely displays output of your code so you can check and share the results\n",
602+
"- Avoids using the command line\n",
603+
"- Avoids installation problems across different computers and operating systems"
583604
]
584605
},
585606
{
586607
"cell_type": "markdown",
587608
"metadata": {
609+
"editable": true,
588610
"slideshow": {
589-
"slide_type": "subslide"
590-
}
611+
"slide_type": ""
612+
},
613+
"tags": [
614+
"nyu-only"
615+
]
591616
},
592617
"source": [
593-
"### Command line vs. Jupyter\n",
594-
"\n",
595-
"![Command line vs. Jupyter output](extras/img/cli_vs_jupyter.png)"
618+
"We're using [JupyterHub](https://jupyter.org/hub), [offered by NYU's High Performance Computing (HPC) group](https://sites.google.com/nyu.edu/nyu-hpc/training-support/resources-for-classes/jupyterhub)."
596619
]
597620
},
598621
{
599622
"cell_type": "markdown",
600623
"metadata": {
624+
"editable": true,
601625
"slideshow": {
602-
"slide_type": "subslide"
603-
}
626+
"slide_type": ""
627+
},
628+
"tags": [
629+
"columbia-only"
630+
]
604631
},
605632
"source": [
606-
"### Try it!\n",
607-
"\n",
608-
"1. Go to [{{coding_env_name}}]({{coding_env_url}})\n",
609-
"1. Create a notebook{% if id == \"nyu\" %}\n",
610-
" 1. Click `New`\n",
611-
" 1. Click `Notebook`\n",
612-
" 1. When it asks you to `Select Kernel`, choose `Python [conda env:python-public-policy]`\n",
613-
"{%- endif %}\n",
614-
"1. Paste in [the following example](https://plotly.com/python/linear-fits/#linear-fit-trendlines-with-plotly-express)\n",
615-
"1. Press the ▶️ button (or `Control`+`Enter` on your keyboard)\n",
616-
"\n",
617-
"```python\n",
618-
"import plotly.express as px\n",
619-
"\n",
620-
"df = px.data.tips()\n",
621-
"fig = px.scatter(df, x=\"total_bill\", y=\"tip\", trendline=\"ols\")\n",
622-
"fig.show()\n",
623-
"``` "
633+
"We're using a service called [{{coding_env_name}}]({{coding_env_url}}) for their Jupyter functionality."
624634
]
625635
},
626636
{
@@ -631,7 +641,9 @@
631641
}
632642
},
633643
"source": [
634-
"FYI `px.data.tips()` loads one of [Plotly's sample datasets](https://plotly.com/python-api-reference/generated/plotly.express.data.html). You don't need that when plotting other datasets."
644+
"### Command line vs. Jupyter\n",
645+
"\n",
646+
"![Command line vs. Jupyter output](extras/img/cli_vs_jupyter.png)"
635647
]
636648
},
637649
{
@@ -658,9 +670,11 @@
658670
{
659671
"cell_type": "markdown",
660672
"metadata": {
673+
"editable": true,
661674
"slideshow": {
662675
"slide_type": "subslide"
663-
}
676+
},
677+
"tags": []
664678
},
665679
"source": [
666680
"#### Running\n",
@@ -675,9 +689,11 @@
675689
{
676690
"cell_type": "markdown",
677691
"metadata": {
692+
"editable": true,
678693
"slideshow": {
679694
"slide_type": "subslide"
680-
}
695+
},
696+
"tags": []
681697
},
682698
"source": [
683699
"#### Output\n",
@@ -687,6 +703,35 @@
687703
"- Just because there's existing output from a cell, doesn't mean that cell has been run during this session"
688704
]
689705
},
706+
{
707+
"cell_type": "markdown",
708+
"metadata": {
709+
"editable": true,
710+
"slideshow": {
711+
"slide_type": "subslide"
712+
},
713+
"tags": []
714+
},
715+
"source": [
716+
"### [Opening a class notebook](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments.html#getting-started)"
717+
]
718+
},
719+
{
720+
"cell_type": "markdown",
721+
"metadata": {
722+
"editable": true,
723+
"slideshow": {
724+
"slide_type": "subslide"
725+
},
726+
"tags": []
727+
},
728+
"source": [
729+
"Can use for:\n",
730+
"\n",
731+
"- Playing with examples\n",
732+
"- Taking notes"
733+
]
734+
},
690735
{
691736
"cell_type": "markdown",
692737
"metadata": {

0 commit comments

Comments
 (0)