IPython Basics

This is a reading note for Python for Data Analysis, producted by O’Reilly, 2012, Chapter 3, IPython: An Interactive Computing and Development Environment. This chapter including basic knowledge about IPython, and its application in data analysis.

Note: All tips that is written by book will has a sign near it.
All code example in this post comes from book.

In IPython, print is used to print more readable result.

Same as what’s happening in terminal, <tab> button in IPython can do auto-complete.


object introspection: ?variable_name in IPython can provide information about this variable:

function_name?? will show this function’s source code if exists.

*name* is wildcard operation. It can list result that is combined by ‘XXnameX’ or ‘nameXXX’

%paste and %cpaste can takes code on clipboard then execute it in a single block in the shell

magic command: It is prefixed by the percentage symbol %