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:
?
- 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*?
%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.
eg. !ls
, !pwd
, etc
%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.