Skip to content

Latest commit

 

History

History

ipython

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

IPython (Jupyter Notebook)

This part of study follows the book Python Data Science Handbook: Essential Tools for Working with Data.

The details of this page can be found in the jupyter notebook, including examples and code excutions.

Here are some tricks that I feel useful:

Misc Tricks

? - Can be used to access documentations. eg. len?, str.insert?,

?? - Can be used to access source code. Note: It won't display the source code sometimes because many functions are not written in python. They are written in C, or else. In this case, ?? only functions as ?.

* ? - They can together be used for wildcard matching beyond tab completions. eg. *Warning?, str.*find*?

Magic Commands

%lsmagic - Shows available line magics.

%run - Run external code.

%timeit - Loop through the command and gives mean and standard deviation of the time spent.

%time - Time without looping.

! - Shell Commands in IPython

eg. !ls, !pwd, etc

Errors and Debugging

%xmode Plain, %xmode Verbose, etc. can be used to change how much info to show for the exception handlers.

%pdb on can be used to automatically start pdb when there is any error raised.