{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Using Jupyter Notebooks on Crane\n", "\n", "\n", "\n", "\n", "### HCC Fall Kickstart 2018 - October 16, 2018\n", "\n", "##### Carrie Brown" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# What is Jupyter Notebook?\n", "\n", "Jupyter Notebook is a web-based application used to create documents that contain code, visualizations and narrative text. Can we used interactively, or to create static reports.\n", "\n", "**These slides were created using a Jupyter Notebook**\n", "\n", "You can find this notebook in `job-examples/jupyter/jupyter_overview.ipynb`." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Layout of a Notebook\n", "\n", "Notebooks are built of cells which can be executed individually. Cells can either contain code or text.\n", "\n", "Text cells are rendered using Markdown, a lightweight markup language that can be used to create basic formatting or even including more complicated elements such as LaTeX. Similar in concept but simplier than HTML." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "With markdown, we can insert:\n", "\n", "### Headlines:\n", "\n", "# Headline 1\n", "## Headline 2\n", "### Headine 3\n", "#### Headline 4\n", "##### Headline 5" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "fragment" } }, "source": [ "### Bulletted nested lists:\n", " - item 1\n", " - subitem A\n", " - subsubitem a\n", " - subitem B\n", " - item 2\n", " - item 3\n", " \n", "### Numbered nested lists:\n", " 1. item 1\n", " 1. subitem A\n", " 1. subsubitem a\n", " 1. subitem B\n", " 1. item 2\n", " 1. item 3" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "fragment" } }, "source": [ "### Links:\n", "[Holland Computing Center](http://hcc.unl.edu)\n", "\n", "### Tables:\n", "| | col1 | col2 | col3 |\n", "|---------|--------|--------|--------|\n", "| row1 | data11 | data12 | data13 |\n", "| row2 | data21 | data22 | data23 |\n", "| row3 | data31 | data32 | data33 |\n", "\n", "### Even LaTeX equations\n", "Both inline: $e^{i\\pi} + 1 = 0$ and displayed:\n", "\n", "$$e^x=\\sum_{i=0}^\\infty \\frac{1}{i!}x^i$$" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Kernels at HCC\n", "\n", "The ‘kernel’ is a program that runs and introspects the user’s code. We have several popular kernels available for Jupyter Notebooks at HCC.\n", " - Python 2 and 3\n", " - R\n", " - MATLAB\n", " - SAS\n", " - Julia\n", " - TensorFlow (Python 2 and 3)\n", " \n", "If you need an additional kernel, let us know by completing a software installation request: https://hcc.unl.edu/software-installation-request" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Using libraries and packages in Jupyter Notebook\n", "\n", "HCC has many of the commonly used packages and libraries already installed such as SciPy and the core tidyverse packages in R.\n", "\n", "If you need custom environments, you can build them yourself using Anaconda. For information on how to use Anaconda with Jupyter Notebooks, check out our documentation at https://hcc-docs.unl.edu/display/HCCDOC/Using+Anaconda+Package+Manager" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Accessing JupyterHub on Crane\n", "\n", "Login using your HCC credentials at http://crane.unl.edu\n", "\n", "Select one of the Notebook options from the dropdown menu and click \n", "\n", "Once your server starts up, open a new notebook by clicking the **New** button in the top right corner." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Example Notebook\n", "\n", "## Iris Data Set in R\n", "\n", "### Load the data\n", "\n", "We can load the built-in iris dataset in R by using the `data()` function." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": true, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "
Sepal.Length | Sepal.Width | Petal.Length | Petal.Width | Species |
---|---|---|---|---|
5.1 | 3.5 | 1.4 | 0.2 | setosa |
4.9 | 3.0 | 1.4 | 0.2 | setosa |
4.7 | 3.2 | 1.3 | 0.2 | setosa |
4.6 | 3.1 | 1.5 | 0.2 | setosa |
5.0 | 3.6 | 1.4 | 0.2 | setosa |
5.4 | 3.9 | 1.7 | 0.4 | setosa |