{ "metadata": { "name": "", "signature": "sha256:dfd361377e5ce6c5325e71d880de561f057e74ccb4d8f996a8269cc2ef04c00e" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Tutorial Brief" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The basics of IPython Notebook. It is a web-based interactive development environment. We will cover the basics of managing notebooks and cell types.\n", "\n", "Finding Help:\n", "\n", "- http://ipython.org/ipython-doc/stable/index.html\n", "- http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Index.ipynb\n" ] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Notebooks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Notebooks are documents representing all input and output of operations. This includes code, text input and numerical, text and rich media output. These files have **ipynb** extensions." ] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Cells" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Cells can contain code or documentation. We will explore working with cells." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Markdown Cells" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is a markdown cell. In can contain:\n", "\n", "- Markdown language\n", "- HTML\n", "- LATEX\n", "\n", "```markdown\n", "**Markdown** *Text*\n", "HTML formula\n", "$LATEX%\n", "```\n", "**Markdown** *Text*\n", "\n", "HTML\n", "\n", "$LATEX formula$" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Code Cells" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "May contain python code and ipython magic." ] }, { "cell_type": "code", "collapsed": false, "input": [ "3+5" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 1, "text": [ "8" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "1+2\n", "3+5" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 2, "text": [ "8" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "x = 1\n", "y = 2\n", "\n", "x + y" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 3, "text": [ "3" ] } ], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "z = x + y\n", "z" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "3" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "IPython Magic" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%%bash\n", "ls\n", "echo \"** Creating New File **\"\n", "touch test.txt\n", "ls\n", "echo \"** Deleting New File **\"\n", "rm test.txt" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Raw NBConvert" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These cells are like markdown but they do not render their input." ] }, { "cell_type": "raw", "metadata": {}, "source": [ "This is a Raw NBConvert cell.\n", "\n", "It doesn't render its contents like\n", "**Markdown**\n", "HTML\n", "$LATEX$\n", "\n", "The problem with them is they may render come tags in IPython NBViwer." ] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Heading Cells" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Heading cells are great for creating bookmarks in an IPython Notebook. You can hover over headings to find their link. Usually it is capitalized slug of the title text. This helps in linking to a specific part of a notebook." ] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Head 1" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Head 2" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Head 3" ] }, { "cell_type": "heading", "level": 4, "metadata": {}, "source": [ "Head 4" ] }, { "cell_type": "heading", "level": 5, "metadata": {}, "source": [ "Head 5" ] }, { "cell_type": "heading", "level": 6, "metadata": {}, "source": [ "Head 6" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Linking to a heading" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Linking to a heading is like linking to an HTML Bookmark. You can do that like this:\n", "\n", "###Relative links:\n", "```HTML\n", "Link to Head 1\n", "```\n", "\n", "Link to Head 1\n", "\n", "###Absolute links:\n", "```HTML\n", "Link to Head 1\n", "```\n", "Link to Head 1" ] } ], "metadata": {} } ] }