{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from __future__ import print_function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Jupyter\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We'll be using Jupyter for all of our examples -- this allows us to run python in a web-based notebook, keeping a history of input and output, along with text and images.\n", "\n", "For Jupyter help, visit:\n", "https://jupyter.readthedocs.io/en/latest/content-quickstart.html" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We interact with python by typing into _cells_ in the notebook. By default, a cell is a _code_ cell, which means that you can enter any valid python code into it and run it. Another important type of cell is a _markdown_ cell. This lets you put text, with different formatting (italics, bold, etc) that describes what the notebook is doing.\n", "\n", "You can change the cell type via the menu at the top, or using the shortcuts:\n", "\n", " * _command-mode_ m : mark down cell\n", " * _command-mode_ y : code cell\n", " \n", "Command mode is indicated by a grey cell border with a blue left margin (if you see it green now, it means you\n", "are in editing mode)\n", " \n", "Command-mode determines whether you are in editing or executing mode (if any of you is\n", "familiar with *vi* or *emacs* then you understand).\n", "\n", "To enter command-mode press ESC or click on the outside of the markdown cell.\n", "\n", "When you are in command mode, you are able to edit the notebook as a whole, but not type into individual cells. Most importantly, in command mode, the keyboard is mapped to a set of shortcuts that let you perform notebook and cell actions efficiently. For example, if you are in command mode and you press **c**, you will copy the current cell - no modifier is needed.\n", "\n", "Don’t try to type into a cell in command mode; unexpected things will happen!\n", "\n", "Some useful short-cuts:\n", "\n", "shift+enter = run cell and jump to the next (creating a new cell if there is no other new one)\n", "ctrl+enter = run cell-in place\n", "alt+enter = run cell and insert a new one below\n", "ctrl+m lists other commands\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# MARKDOWN BASICS\n", "\n", "Jupyter notebooks use markdown language for text.\n", "In a nutshell, **markdown** is a very easy and powerfull\n", "text formatting language.\n", "\n", "As everything in this course, I expect that you will\n", "learn it as you progress and I imagine that you will use\n", "it to the extent that you need it.\n", "_bottom line: you will learn basic things and google \n", "help for anything that you do not know and need_\n", "\n", ">AND THAT IS OK IN THIS COURSE!!!\n", "\n", "# Markdown tutorial\n", "\n", "Note that at any time you can modify any of my Jupyter notebooks. The original ones are always saved in the\n", "repository of the course, and the purpose of this course is that you learn by experimentation!\n", "\n", "So lets do it.\n", "Here is a very nice and quick tutorial that you only need to do once: [tutorial](https://www.markdowntutorial.com/)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A \"markdown cell\" enables you to typeset LaTeX equations right in your notebook. Just put them in $ or $$:\n", "\n", "$$\\frac{\\partial \\rho}{\\partial t} + \\nabla \\cdot (\\rho U) = 0$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "