IPython / Jupyter¶

  1. Python For Data Science Cheat Sheet Jupyter Notebook
  2. Jupyter Notebook Tutorial
  3. Jupyter Notebook Cheat Sheet Pdf

The markdown cell in Jupyter Notebook can display six levels of heading. For making a heading, start the syntax with # followed by a space and then the text. This will make the heading of level 1 – The biggest. To decrease the size of the heading start.

  1. Jupyter Notebook files Notebooks written entirely in Markdown Custom notebook formats and Jupytext reStructuredText files Build your book Build your book Execute your computational content Formatting code outputs. # MyST Cheat Sheet. Level 1-6 headings, denoted by number of #.
  2. Jupyter Notebook Cheat Sheet Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. It is used for data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.
  • Using IPython makes interactive work easy.
    • Better shell
    • Notebook interface
    • Embeddable kernel
    • Parallel python

IPython shell shortcuts¶

  • TAB expansion to complete python names and file paths
  • ~ and * directory / file expansion
  • many 'magic' methods:

Help¶

%pdoc%pdef%psource for docstring, function definition, source code only.

Run¶

To run a program directly from the IPython console:

%run has special flags for timing the execution of your scripts (-t) or for running them under the control of either Python's pdb debugger (-d) or profiler (-p):

Other Commands¶

  • %reset is not a kernel restart
  • Restart with Ctrl+. in 'qtconsole'
  • import module ; reload(module) to reload a module from disk

Debugging¶

OS Commands¶

History¶

GUI integration¶

Start with ipython --gui=qt or at the IPython prompt:

Arguments can be wx, qt, gtk and tk.

Matplotlib / pylab graphics in an iPython shell¶

Start with: ipython --matplotlib ( or --matplotlib=qt etc..)

At the IPython prompt:

%pylab makes the following imports:

CheatCheat Sheet Jupyter Notebook

At the command prompt:

alternative: --matplotlib inlineor within IPython:

To embed plots, SVG or HTML in qtconsole, call display:

Jupyter notebook keyboard shortcuts pdf

IPython Notebook web-based interface¶

  • Start with: ipython notebook and switch to browser
  • Keyboard shortcuts:
    • Enter to edit a cell
    • Shift + Enter to evaluate
    • Ctrl + m or Esc for the 'command mode'

In command mode:

Papermill is a tool for parameterizing and executing Jupyter Notebooks.

Anaconda¶

  • Anaconda Cheat Sheet. PDF only.
  • Conda Cheat Sheet. PDF.


Jupyter Notebook¶

  • Jupyter Notebook. PDF.

  • Jupyter Notebook. PDF

Objects¶

Find, list, search, reset.

Logging¶

Start, state, on, off.

Magic & Help¶

Mac os high sierra latest update. List, help.

Open a window about magic commands.

Open a window about the command (minimum, maximum help).

Cheat Sheet Jupyter NotebookJupyter

Function¶

docstrings, info, source.

Open a window about the docstrings.

Open a window about the function.

Navigation¶

Bookmark, history.

Add a bookmark.

Delete a bookmark.

Print the directory navigation history.

External¶

Bash, script.

The following is an example of one bash command.

Python For Data Science Cheat Sheet Jupyter Notebook

Invoke an external script into IPython.

Jupyter Notebook Tutorial

Invoke an external script into IPython and open a window about the script’s profile.

Jupyter Notebook Cheat Sheet Pdf

Load the external script into IPython (loadprint_text.py turns into #%loadprint_text.py).