{"id":6868,"date":"2020-08-31T12:14:39","date_gmt":"2020-08-31T16:14:39","guid":{"rendered":"https:\/\/blogs.swarthmore.edu\/its\/?p=6868"},"modified":"2020-08-31T12:14:39","modified_gmt":"2020-08-31T16:14:39","slug":"jupyter-at-swarthmore","status":"publish","type":"post","link":"https:\/\/blogs.swarthmore.edu\/its\/2020\/08\/31\/jupyter-at-swarthmore\/","title":{"rendered":"Jupyter @ Swarthmore"},"content":{"rendered":"\n<p>Did you know that Swarthmore College has a JupyterHub installation that allows you to work on and save your Jupyter Notebooks in the cloud?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a Jupyter Notebook?<\/h2>\n\n\n\n<p>A Jupyter Notebook is a computing environment that enables the author to write content containing interactive code, videos, charts, and pretty much anything else the Jupyter kernel (In Swarthmore&#8217;s case, Python) provides.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What can I do with a Jupyter Notebook?<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Run and edit code in the browser<\/li><li>See the results of computation through rich media representations such as HTML, PNG, SVG, PDF, etc.<\/li><li>Create narrative text using <a href=\"https:\/\/www.markdownguide.org\/\">Markdown<\/a> <\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">More about Jupyter Notebooks<\/h2>\n\n\n\n<p>A Jupyter Notebook is composed of blocks called cells. Each cell can have a different type. They will most commonly have a type of <strong>Markdown<\/strong> or <strong>Code<\/strong>. In the example below, the top cell is a Markdown cell while the bottom is Code cell.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"123\" src=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM-1024x123.png\" alt=\"A Markdown cell and a code cell from a Jupyter notebook\" class=\"wp-image-6869\" srcset=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM-1024x123.png 1024w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM-300x36.png 300w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM-768x92.png 768w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM-1536x185.png 1536w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM-270x32.png 270w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.45.25-AM.png 1614w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Within your notebook, you can do things like import libraries, visualize data, and even share your created notebooks with others.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1816\" height=\"1506\" src=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/output-1.gif\" alt=\"An example of how a Jupyter Notebook can be used to import data\" class=\"wp-image-6873\"\/><\/figure>\n\n\n\n<p>Using Jupyter Notebooks (with a combination of the <a href=\"https:\/\/matplotlib.org\/\">matplotlib<\/a> library) it becomes almost trivial to visualize large datasets<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"878\" src=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM-1024x878.png\" alt=\"\" class=\"wp-image-6879\" srcset=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM-1024x878.png 1024w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM-300x257.png 300w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM-768x658.png 768w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM-1536x1317.png 1536w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM-70x60.png 70w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-9.42.17-AM.png 1612w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><em>Pokemon (Gen 1 &#8211; 7) plotted by their base stats<\/em><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Jupyter Notebooks are a great option for instructors!<\/h3>\n\n\n\n<p>With Juptyer Notebooks, the instructor can release a version of the notebook with instructions written in markdown to their students. The students can then follow along interactively, or submit their notebooks for grading (via Moodle, git, etc).<\/p>\n\n\n\n<p>An example notebook with instructions may look something like the following<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"365\" src=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-1024x365.png\" alt=\"\" class=\"wp-image-6882\" srcset=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-1024x365.png 1024w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-300x107.png 300w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-768x274.png 768w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-1536x548.png 1536w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-2048x731.png 2048w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.38.04-AM-168x60.png 168w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>While a completed notebook may look like this<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"1024\" src=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM-964x1024.png\" alt=\"A (partially) answered Jupyter Notebook\" class=\"wp-image-6884\" srcset=\"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM-964x1024.png 964w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM-282x300.png 282w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM-768x816.png 768w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM-1445x1536.png 1445w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM-56x60.png 56w, https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-31-at-11.47.03-AM.png 1530w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><\/figure>\n\n\n\n<p>You can view the full example notebooks at <a href=\"https:\/\/github.com\/Swarthmore\/example-jupyter-notebooks\">https:\/\/github.com\/Swarthmore\/example-jupyter-notebooks<\/a> or by clicking the following to access them directly<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/Swarthmore\/example-jupyter-notebooks\/blob\/master\/example1.ipynb\">Notebook with instructions<\/a><\/li><li><a href=\"https:\/\/github.com\/Swarthmore\/example-jupyter-notebooks\/blob\/master\/example1-answers.ipynb\">Notebook with answers<\/a><\/li><\/ul>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p><strong>The following packages are available for use on all Swarthmore-hosted Jupyter notebooks<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/matplotlib.org\/\">Matplotlib<\/a><\/li><li><a href=\"https:\/\/pandas.pydata.org\/\">Pandas<\/a><\/li><li><a href=\"https:\/\/numpy.org\/\">Numpy<\/a><\/li><li><a href=\"https:\/\/www.scipy.org\/install.html\">SciPy<\/a><\/li><li><a href=\"https:\/\/seaborn.pydata.org\/\">Seaborn<\/a><\/li><\/ul>\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Jupyter Tips &amp; Tricks<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>You can use <code>shift + return<\/code> to run the current cell of your Notebook, and start a new one.<\/li><li>Pressing <code>tab<\/code> will invoke the notebook&#8217;s autocompletion feature<\/li><li>You can press <code>Esc<\/code> <code>00<\/code> to quickly restart your notebook<\/li><li>Jupyter notebooks have a <code>command<\/code> and an <code>edit<\/code> mode. When your cursor is active inside a cell, you are in <code>edit<\/code> mode. You can switch to <code>command<\/code> mode by pressing <code>Esc<\/code><\/li><li>In <code>edit<\/code> mode, press <code>Ctrl + Shift + -<\/code> to split the current cell<\/li><li>In <code>command<\/code> mode, press <code>Shift + M<\/code> to merge the selected cells<\/li><li>In <code>command<\/code> mode, you can delete the current cell by typing <code>dd<\/code><\/li><li>Jupyter notebooks run in GitHub!<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">More Reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/jupyterlab.readthedocs.io\/en\/latest\/\">JupyterLab documentation<\/a><\/li><\/ul>\n\n\n\n<p>For access to Swarthmore&#8217;s hosted Jupyter notebooks, please <a href=\"http:\/\/support.swarthmore.edu\">contact the Swarthmore help desk<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that Swarthmore College has a JupyterHub installation that allows you to work on and save your Jupyter Notebooks in the cloud? What is a Jupyter Notebook? A Jupyter Notebook is a computing environment that enables the author &hellip; <a href=\"https:\/\/blogs.swarthmore.edu\/its\/2020\/08\/31\/jupyter-at-swarthmore\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Jupyter @ Swarthmore<\/span><\/a><\/p>\n","protected":false},"author":70,"featured_media":6894,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,303,76,125,97],"tags":[90],"class_list":{"0":"post-6868","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-academic-technology","8":"category-development","9":"category-digitaltools","10":"category-open-source","11":"category-software","12":"tag-featured","14":"fallback-thumbnail"},"jetpack_featured_media_url":"https:\/\/blogs.swarthmore.edu\/its\/wp-content\/uploads\/2020\/08\/jupyter.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/ph2nPL-1MM","_links":{"self":[{"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/posts\/6868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/comments?post=6868"}],"version-history":[{"count":25,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/posts\/6868\/revisions"}],"predecessor-version":[{"id":6901,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/posts\/6868\/revisions\/6901"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/media\/6894"}],"wp:attachment":[{"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/media?parent=6868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/categories?post=6868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.swarthmore.edu\/its\/wp-json\/wp\/v2\/tags?post=6868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}