Python for Finance: Analyze Big Financial Data

(Elle) #1

list of all bookmarks:


In  [ 6 ]:  %bookmark py4fi

In  [ 7 ]:  %bookmark   -l
Current bookmarks:
py4fi -> /Users/yhilpisch/Documents/Work/Python4Finance/

System shell commands


Yet another really helpful feature is that you can execute command-line/system shell


functions directly from an IPython prompt or a Notebook cell. To this end you need to use


the ! to indicate that the following command should be escaped to the system shell (or %%!


when a complete cell should be handled that way). As a simple illustration, the following


creates a directory, moves to that directory, moves back, and deletes the directory:


In  [ 7 ]:  !mkdir python4finance

In  [ 8 ]:  cd python4finance/
/Users/yhilpisch/python4finance

In  [ 9 ]:  cd  ..
/Users/yhilpisch

In  [ 10 ]: !rm -rf python4finance/

IPython provides you with all the functions you would expect from a powerful interactive


development environment. It is often the case that people, beginners and experts alike,


even find their way to Python via IPython. Throughout the book, there are a plentitude of


examples illustrating the use of IPython for interactive data and financial analytics. You


should also consult the book by McKinney (2012), and in particular Chapter 3, for further


information on how to use IPython effectively.


Spyder


While IPython satisfies all of most users’ requirements for interactive analytics and


prototyping, larger projects generally demand “something more.” In particular, IPython


itself has no editor directly built into the application.


[ 11 ]

For all those looking for a more


traditional development environment, Spyder might therefore be a good choice.


Similar to IPython, Spyder has been designed to support rapid, interactive development


with Python. However, it also has, for example, a full-fledged editor, more powerful


project management and debugging capabilities, and an object and variable inspector as


well as a full integration of the IPython shell version. Within Spyder you can also start a


standard Python prompt session.


The built-in editor of Spyder provides all you need to do Python development. Among


other features (cf. http://code.google.com/p/spyderlib/wiki/Features), it offers the


following:


Highlighting


Syntax coloring for Python, C/C++, and Fortran code; occurrence highlighting


Introspection


Powerful dynamic code introspection features (e.g., code completion, calltips, object


definition with a mouse click)

Free download pdf