You're reading from IPython Notebook Essentials
Some of the important keyboard shortcuts are as follows:
To go into the Edit mode, press Enter or click on the cell
To go into the Command mode, press Esc
Some of the important shortcuts used in the Edit mode are as follows:
To run a cell, the following shortcuts are used:
To run a cell and move to the next cell, press Shift + Enter
To run a cell, but stay in the same cell, press Ctrl + Enter
To run a cell and insert a new cell below it, press Alt + Enter
To create a new line in the current cell, press Enter
To indent the content, press Tab
To start code completion, start typing in the cell and then press Tab
To select all, press Ctrl + A
To undo an action, press Ctrl + Z
To redo an action, press Ctrl + Y or Ctrl + Shift + Z
To go to the start of the cell, press Ctrl + Home
To go to the end of the cell, press Ctrl + End
To split a cell, press Ctrl + Shift + -
To change the cell mode to one of the following, the shortcuts are as follows:
Code: Press Y
Markdown: Press M
Heading: Press a number between 1 and 6, according to the heading size
Raw NBConvert: Press R
To select a cell above the current cell, press the Up key or K
To select a cell below the current cell, press the Down key or J
To move a cell up by one position, press Ctrl + K
To move a cell down by one position, press Ctrl + J
To insert a new cell above the current cell, press A
To insert a new cell below the current cell, press B
To cut a cell, press X
To copy a cell, press C
To paste a cell above the current cell, press Shift + V
To delete a cell, press D
To undo a delete action, press Z
To merge the current cell with the cell below it, press Shift + M
To toggle line numbers, press L
The steps to load some of the important modules are as follows:
To load
NumPy
and matplotlib to work interactively, along with inline graphics, run the following command:pylab inline
To load
NumPy
and matplotlib without importing names into the current namespace, with inline graphics, run the following command line:pylab -–no-import-all inline
To load
SciPy
modules, use any of the following standard Python import commands:import scipy.<module> import scipy.<module> as <local-name> from scipy.<module> import <function>
If the –no-import-all
options is used, the functions and objects have to be prefixed by the appropriate module name as follows:
For
NumPy
functions and objects, usenumpy
ornp
.For interactive graphics, use
pyplot
orplt
.
Modules from libraries installed in the system as well as the user-created modules with the.py
extension can be imported through the standard Python mechanism.
There are a number of ways to get help:
To start interactive help, run the following command:
help()
To get help with a function or object, run the following command:
help(object) help(function) <object>? <function>?
For tab completion, start typing the name of the function/object/method and press Tab.
To get a tooltip, start typing the name of the function/object/method and press Shift + Tab.