|
546 | 546 | { |
547 | 547 | "cell_type": "markdown", |
548 | 548 | "metadata": { |
| 549 | + "editable": true, |
549 | 550 | "slideshow": { |
550 | 551 | "slide_type": "slide" |
551 | | - } |
| 552 | + }, |
| 553 | + "tags": [] |
552 | 554 | }, |
553 | 555 | "source": [ |
554 | 556 | "## Jupyter\n", |
555 | 557 | "\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 | + "``` " |
561 | 574 | ] |
562 | 575 | }, |
563 | 576 | { |
564 | 577 | "cell_type": "markdown", |
565 | 578 | "metadata": { |
566 | | - "tags": [ |
567 | | - "nyu-only" |
568 | | - ] |
| 579 | + "editable": true, |
| 580 | + "slideshow": { |
| 581 | + "slide_type": "subslide" |
| 582 | + }, |
| 583 | + "tags": [] |
569 | 584 | }, |
570 | 585 | "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." |
572 | 587 | ] |
573 | 588 | }, |
574 | 589 | { |
575 | 590 | "cell_type": "markdown", |
576 | 591 | "metadata": { |
577 | | - "tags": [ |
578 | | - "columbia-only" |
579 | | - ] |
| 592 | + "editable": true, |
| 593 | + "slideshow": { |
| 594 | + "slide_type": "subslide" |
| 595 | + }, |
| 596 | + "tags": [] |
580 | 597 | }, |
581 | 598 | "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" |
583 | 604 | ] |
584 | 605 | }, |
585 | 606 | { |
586 | 607 | "cell_type": "markdown", |
587 | 608 | "metadata": { |
| 609 | + "editable": true, |
588 | 610 | "slideshow": { |
589 | | - "slide_type": "subslide" |
590 | | - } |
| 611 | + "slide_type": "" |
| 612 | + }, |
| 613 | + "tags": [ |
| 614 | + "nyu-only" |
| 615 | + ] |
591 | 616 | }, |
592 | 617 | "source": [ |
593 | | - "### Command line vs. Jupyter\n", |
594 | | - "\n", |
595 | | - "" |
| 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)." |
596 | 619 | ] |
597 | 620 | }, |
598 | 621 | { |
599 | 622 | "cell_type": "markdown", |
600 | 623 | "metadata": { |
| 624 | + "editable": true, |
601 | 625 | "slideshow": { |
602 | | - "slide_type": "subslide" |
603 | | - } |
| 626 | + "slide_type": "" |
| 627 | + }, |
| 628 | + "tags": [ |
| 629 | + "columbia-only" |
| 630 | + ] |
604 | 631 | }, |
605 | 632 | "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." |
624 | 634 | ] |
625 | 635 | }, |
626 | 636 | { |
|
631 | 641 | } |
632 | 642 | }, |
633 | 643 | "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 | + "" |
635 | 647 | ] |
636 | 648 | }, |
637 | 649 | { |
|
658 | 670 | { |
659 | 671 | "cell_type": "markdown", |
660 | 672 | "metadata": { |
| 673 | + "editable": true, |
661 | 674 | "slideshow": { |
662 | 675 | "slide_type": "subslide" |
663 | | - } |
| 676 | + }, |
| 677 | + "tags": [] |
664 | 678 | }, |
665 | 679 | "source": [ |
666 | 680 | "#### Running\n", |
|
675 | 689 | { |
676 | 690 | "cell_type": "markdown", |
677 | 691 | "metadata": { |
| 692 | + "editable": true, |
678 | 693 | "slideshow": { |
679 | 694 | "slide_type": "subslide" |
680 | | - } |
| 695 | + }, |
| 696 | + "tags": [] |
681 | 697 | }, |
682 | 698 | "source": [ |
683 | 699 | "#### Output\n", |
|
687 | 703 | "- Just because there's existing output from a cell, doesn't mean that cell has been run during this session" |
688 | 704 | ] |
689 | 705 | }, |
| 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 | + }, |
690 | 735 | { |
691 | 736 | "cell_type": "markdown", |
692 | 737 | "metadata": { |
|
0 commit comments