Reader small image

You're reading from  IPython Notebook Essentials

Product typeBook
Published inNov 2014
Publisher
ISBN-139781783988341
Edition1st Edition
Tools
Right arrow
Author (1)
Luiz Felipe Martins
Luiz Felipe Martins
author image
Luiz Felipe Martins

Luiz Felipe Martins holds a PhD in applied mathematics from Brown University and has worked as a researcher and educator for more than 20 years. His research is mainly in the field of applied probability. He has been involved in developing code for the open source homework system, WeBWorK, where he wrote a library for the visualization of systems of differential equations. He was supported by an NSF grant for this project. Currently, he is an Associate Professor in the Department of Mathematics at Cleveland State University, Cleveland, Ohio, where he has developed several courses in applied mathematics and scientific computing. His current duties include coordinating all first-year calculus sessions.
Read more about Luiz Felipe Martins

Right arrow

Appendix A. IPython Notebook Reference Card

Starting the notebook


To start the notebook, open a terminal window and run the following command:

ipython notebook

It is important that you are in the directory that contains your notebooks when you run the preceding command.

Keyboard shortcuts


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

Shortcuts in the Edit mode

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 + -

Shortcuts in the Command mode

  • To list the keyboard shortcuts, press H

  • 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 below the current cell, press V

  • 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

Importing modules


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, use numpy or np.

  • For interactive graphics, use pyplot or plt.

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.

Getting help


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.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
IPython Notebook Essentials
Published in: Nov 2014Publisher: ISBN-13: 9781783988341
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Luiz Felipe Martins

Luiz Felipe Martins holds a PhD in applied mathematics from Brown University and has worked as a researcher and educator for more than 20 years. His research is mainly in the field of applied probability. He has been involved in developing code for the open source homework system, WeBWorK, where he wrote a library for the visualization of systems of differential equations. He was supported by an NSF grant for this project. Currently, he is an Associate Professor in the Department of Mathematics at Cleveland State University, Cleveland, Ohio, where he has developed several courses in applied mathematics and scientific computing. His current duties include coordinating all first-year calculus sessions.
Read more about Luiz Felipe Martins