{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# The Jupyter Notebook\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Interactive computing\n", "\n", "The Jupyter Notebook is an **interactive computing environment** that enables users to author notebook documents that include: \n", "- Live code\n", "- Interactive widgets\n", "- Plots\n", "- Narrative text\n", "- Equations\n", "- Images\n", "- Video\n", "\n", "These documents provide a **complete and self-contained record of a computation** that can be converted to various formats and shared with others using email, [Dropbox](https://www.dropbox.com/), version control systems (like git/[GitHub](https://github.com)) or [nbviewer.jupyter.org](https://nbviewer.jupyter.org)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Multiple languages\n", "\n", "Through Jupyter's kernel and messaging architecture, the Notebook allows code to be run in a range of different programming languages. For each notebook document that a user opens, the web application starts a kernel that runs the code for that notebook. There are kernels available in the following languages:\n", "* Python(https://github.com/ipython/ipython)\n", "* C++ (https://github.com/root-project/root/)\n", "* Julia (https://github.com/JuliaLang/IJulia.jl)\n", "* R (https://github.com/IRkernel/IRkernel)\n", "* Ruby (https://github.com/minrk/iruby)\n", "* Scala (https://github.com/Bridgewater/scala-notebook)\n", "* node.js (https://gist.github.com/Carreau/4279371)\n", "* Go (https://github.com/takluyver/igo)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### The notebook document\n", "\n", "Notebooks consist of a **linear sequence of cells**. There are three basic cell types:\n", "\n", "* **Code cells:** Input and output of live code that is run in the kernel\n", "* **Markdown cells:** Narrative text with embedded LaTeX equations\n", "* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n", "\n", "Internally, notebook documents are [JSON](https://en.wikipedia.org/wiki/JSON) **data** with **binary values** [base64](https://en.wikipedia.org/wiki/Base64) encoded. This allows them to be **read and manipulated programmatically** by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n", "\n", "Tip: **shift + enter** to run a cell!" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "# Write code and execute it, produce text output\n", "print(\"This is code!\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "# Display an image\n", "from IPython.display import Image\n", "Image(filename='images/cern-logo.png') " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "import ipywidgets as widgets\n", "widgets.Dropdown(\n", " options=['1', '2', '3'],\n", " value='2',\n", " description='Number:',\n", " disabled=False,\n", ")" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Write _formatted_ **markdown text**" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Use cases\n", "\n", "* Programming and Computer Science\n", "* Statistics, Machine Learning and Data Science\n", "* Mathematics, Physics, Chemistry, Biology\n", "* Earth Science and Geo-Spatial data\n", "* Linguistics and Text Mining\n", "* Signal Processing, Engineering Education\n", "* and even Psychology and Neuroscience" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "For more information, please visit: https://jupyter-notebook.readthedocs.io\n", "\n", "Notebook examples available at: https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks" ] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.6" } }, "nbformat": 4, "nbformat_minor": 2 }