Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Mastering Python for Finance
Mastering Python for Finance

Mastering Python for Finance: Understand, design, and implement state-of-the-art mathematical and statistical applications used in finance with Python

eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering Python for Finance

Chapter 1. Python for Financial Applications

In this introductory chapter, we will explore the aspects of Python in order to judge its suitability as a programming language in finance. Notably, Python is widely practiced in various financial sectors, such as banking, investment management, insurance, and even in real estate for building tools that help in financial modeling, risk management, and trading. To help you get the most from the multitude of features that Python has to offer, we will introduce the IPython Notebook as a beneficial tool to help you visualize data and to perform scientific computing for presentation to end users.

In this chapter, we will cover the following topics:

  • Benefits of Python over other programming languages for financial studies
  • Features of Python for financial applications
  • Implementing object-oriented design and functional design in Python
  • Overview of IPython
  • Getting IPython and IPython Notebook started
  • Creating and saving notebook documents
  • Various formats to export a notebook document
  • Notebook document user interface
  • Inserting Markdown language into a notebook document
  • Performing calculations in Python in a notebook document
  • Creating plots in a notebook document
  • Various ways of displaying mathematical equations in a notebook document
  • Inserting images and videos into a notebook document
  • Working with HTML and pandas DataFrame in a notebook document

Is Python for me?

Today's financial programmers have a diverse choice of programming languages in implementing robust software solutions, ranging from C, Java, R, and MATLAB. However, each programming language was designed differently to accomplish specific tasks. Their inner workings, behavior, syntax, and performance affect the results of every user differently.

In this book, we will focus exclusively on the use of Python for analytical and quantitative finance. Originally intended for scientific computations, the Python programming language saw an increasingly widespread use in financial operations. In particular, pandas, a software library written for the Python programming language, was open sourced by an employee of AQR Capital Management to offer high-performance financial data management and quantitative analysis.

Even big financial corporations embrace Python to architect their infrastructure. Bank of America's Quartz platform uses Python for position management, pricing, and risk management. JP Morgan's Athena platform, a cross-market risk management and trading system, uses Python for flexibility in combination with C++ and Java.

The application of Python in finance is vast, and in this book, we will cover the fundamental topics in creating financial applications, such as portfolio optimization, numerical pricing, interactive analytics, big data with Hadoop, and more.

Here are some considerations on why you might use Python for your next financial application.

Free and open source

Python is free in terms of license. Documentation is widely available, and many Python online community groups are available, where one can turn in times of doubt. Because it is free and open source, anyone can easily view or modify the algorithms in order to adapt to customized solutions.

Being accessible to the public opens a whole new level of opportunities. Anyone can contribute existing enhancements or create new modules. For advanced users, interoperability between different programming languages is supported. A Python interpreter may be embedded in C and C++ programs. Likewise, with the appropriate libraries, Python may be integrated with other languages not limited to Fortran, Lisp, PHP, Lua, and more.

Python is available on all major operating systems, such as Windows, Unix, OS/2, Mac, among others.

High-level, powerful, and flexible

Python as a general-purpose, high-level programming language allows the user to focus on problem solving and leave low-level mechanical constructs such as memory management out of the picture.

The expressiveness of the Python programming language syntax helps quantitative developers in implementing prototypes quickly.

Python allows the use of object-oriented, procedural, as well as functional programming styles. Because of this flexibility, it is especially useful in implementing complex mathematical models containing multiple changeable parameters.

A wealth of standard libraries

By now, you should be familiar with the NumPy, SciPy, matplotlib, statsmodels, and pandas modules, as indispensable tools in quantitative analysis and data management.

Other libraries extend the functionalities of Python. For example, one may turn Python into a data visualization tool with the gnuplot package in visualizing mathematical functions and data interactively. With Tk-based GUI tools such as Tkinter, it is possible to turn Python scripts into GUI programs.

A widely popular shell for Python is IPython, which provides interactive computing and high-performance tools for parallel and distributed computing. With IPython Notebook, the rich text web interface of IPython, you can share code, text, mathematical expressions, plots, and other rich media with your target audience. IPython was originally intended for scientists to work with Python and data.

Objected-oriented versus functional programming

If you are working as a programmer in the finance industry, chances are that your program will be built for handling thousands or millions of dollars' worth in transactions. It is crucial that your programs are absolutely free of errors. More often than not, bugs arise due to unforeseen circumstances. As financial software systems and models become larger and more complex, practicing good software design is crucial. While writing the Python code, you may want to consider the object-oriented approach or the functional approach to structure your code for better readability.

The object-oriented approach

As the demand for clarity, speed, and flexibility in your program increases, it is important to keep your code readable, manageable, and lean. One popular technical approach to building software systems is by applying the object-oriented paradigm. Consider the following example of displaying a greeting message as a class:

class Greeting(object):

    def __init__(self, my_greeting):
        self.my_greeting = my_greeting

    def say_hello(self, name):
        print "%s %s" % (self.my_greeting, name)

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/ support and register to have the files e-mailed directly to you.

We created a class called Greeting that is capable of accepting an input argument in its constructor. For this example, we will define our greeting as "Hello". The say_hello function is invoked with an input name and prints our greeting messages as follows:

>>> greeting = Greeting("Hello")
>>> greeting.say_hello("World")
>>> greeting.say_hello("Dog")
>>> greeting.say_hello("Cat")
Hello World
Hello Dog
Hello Cat

The functional approach

We can achieve the same Greeting functionality using the functional approach. Functional programming is a programming paradigm, where computer programs are structured and styled in such a way that they can be evaluated as mathematical functions. These pseudo mathematical functions avoid changing state data, while increasing reusability and brevity.

In Python, a function object can be assigned to a variable and, like any other variables, can be passed into functions as an argument as well as return its value.

Let's take a look at the following code that gives us the same output:

from functools import partial
def greeting(my_greeting, name):
    print "%s %s" % (my_greeting, name)

Here, we defined a function named greeting that takes in two arguments. Using the partial function of the functools module, we treated the function, greeting, as an input variable, along with our variable greeting message as Hello.

>>> say_hello_to = partial(greeting, "Hello")
>>> say_hello_to("World")
>>> say_hello_to("Dog")
>>> say_hello_to("Cat")

We assigned the say_hello_to variable as its return value, and reused this variable in printing our greetings with three different names by executing it as a function that accepts input arguments.

Which approach should I use?

There is no clear answer to this question. We have just demonstrated that Python supports both the object-oriented approach and the functional approach. We can see that in certain circumstances the functional approach in software development is brevity to a large extent. Using the say_hello_to function provides better readability over greeting.say_hello(). It boils down to the programmer's decision as to what works best in making the code more readable and having ease of maintenance during the software life cycle while collaborating with fellow developers.

As a general rule of thumb, in large and complex software systems representing objects as classes helps in code management between team members. By working with classes, the scope of work can be more easily defined, and system requirements can be easily scaled using object-oriented design. When working with financial mathematical models, using functional programing helps to keep the code working in the same fashion as its accompanying mathematical concepts.

Which Python version should I use?

The code examples in this book have been tested in Python 2.7 but are optimized to run on Python 3. Many of the third-party Python modules mentioned in this book require at least Python 2.7, and some do not have support for Python 3 as yet. To achieve the best compatibility, it is recommended that you install Python 2.7 on your workstation.

If you have not installed Python on your workstation, you can find out more about Python from the official source at https://www.python.org. However, in order to build financial applications from the examples, you are required to use a number of additional third-party Python modules such as NumPy, SciPy, and pandas. It is recommended that you obtain an all-in-one installer to ease the installation procedures. The following are some popular installers that include hundreds of supported packages:

Introducing IPython

IPython is an interactive shell with high-performance tools used for parallel and distributed computing. With the IPython Notebook, you can share code, text, mathematical expressions, plots, and other rich media with your target audience.

In this section, we will learn how to get started and run a simple IPython Notebook.

Getting IPython

Depending on how you have installed Python on your machine, IPython might have been included in your Python environment. Please consult the IPython official documentation for the various installation methods most comfortable for you. The official page is available at http://ipython.org.

IPython can be downloaded from https://github.com/ipython. To install IPython, unpack the packages to a folder. From the terminal, navigate to the top-level source directory and run the following command:

$ python setup.py install

Using pip

The pip tool is a great way to install Python packages automatically. Think of it as a package manager for Python. For example, to install IPython without having to download all the source files, just run the following command in the terminal:

$ pip install ipython

To get pip to work in the terminal, it has to be installed as a Python module. Instructions for downloading and installing pip can be found at https://pypi.python.org/pypi/pip.

The IPython Notebook

The IPython Notebook is the web-based interactive computing interface of IPython used for the whole computation process of developing, documenting, and executing the code. This section covers some of the common features in IPython Notebook that you may consider using for building financial applications.

Here is a screenshot of the IPython Notebook in Windows OS:

The IPython Notebook

Notebooks allow in-browser editing and executing of the code with the outputs attached to the code that generated them. It has the capability of displaying rich media, including images, videos, and HTML components.

Its in-browser editor allows the Markdown language that can provide rich text and commentary for the code.

Mathematical notations can be included with the use of LaTeX, rendered natively by MathJax. With the ability to import Python modules, publication-quality figures can be included inline and rendered using the matplotlib library.

Notebook documents

Notebook documents are saved with the .ipynb extension. Each document contains everything related to an interactive session, stored internally in the JSON format. Since JSON files are represented in plain text, this allows notebooks to be version controlled and easily sharable.

Notebooks can be exported to a range of static formats, including HTML, LaTeX, PDF, and slideshows.

Notebooks can also be available as static web pages and served to the public via URLs using nbviewer (IPython Notebook Viewer) without users having to install Python. Conversion is handled using the nbconvert service.

Running the IPython Notebook

Once you have IPython successfully installed in the terminal, type the following command:

$ ipython notebook

This will start the IPython Notebook server service, which runs in the terminal. By default, the service will automatically open your default web browser and navigate to the landing page. To access the notebook program manually, enter the http://localhost:8888 URL address in your web browser.

Tip

By default, a notebook runs in port 8888. To infer the correct notebook address, check the log output from the terminal.

The landing page of the notebook web application is called the dashboard, which shows all notebooks currently available in the notebook directory. By default, this directory is the one from which the notebook server was started.

Creating a new notebook

Click on New Notebook from the dashboard to create a new notebook. You can navigate to the File | New menu option from within an active notebook:

Creating a new notebook

Here, you will be presented with the notebook name, a menu bar, a toolbar, and an empty code cell.

The menu bar presents different options that may be used to manipulate the way the notebook functions.

The toolbar provides shortcuts to frequently used notebook operations in the form of icons.

Notebook cells

Each logical section in a notebook is known as a cell. A cell is a multi-line text input field that accepts plain text. A single notebook document contains at least one cell and can have multiple cells.

To execute the contents of a cell, from the menu bar, go to Cell | Run, or click on the Play button from the toolbar, or use the keyboard shortcut Shift + Enter.

Each cell can be formatted as a Code, Markdown, Raw NBConvert, or heading cell:

Notebook cells

Code cell

By default, each cell starts off as a code cell, which executes the Python code when you click on the Run button. Cells with a rounded rectangular box and gray background accept text inputs. The outputs of the executed box are displayed in the white space immediately below the text input.

Markdown cell

Markdown cells accept the Markdown language that provides a simple way to format plain text into rich text. It allows arbitrary HTML code for formatting.

Mathematical notations can be displayed with standard LaTeX and AMS-LaTeX (the amsmath package). Surround the LaTeX equation with $ to display inline mathematics, and $$ to display equations in a separate block. When executed, MathJax will render Latex equations with high-quality typography.

Raw NBConvert cell

Raw cells provide the ability to write the output directly and are not evaluated by the notebook.

Heading cells

Cells may be formatted as a heading cell, from level 1 (top level) to level 6 (paragraph). These are useful for the conceptual structure of your document or to construct a table of contents.

Simple exercises with IPython Notebook

Let's get started by creating a new notebook and populating it with some content. We will insert the various types of objects to demonstrate the various tasks.

Creating a notebook with heading and Markdown cells

We will begin by creating a new notebook by performing the following steps:

  1. Click on New Notebook from the dashboard to create a new notebook. If from within an active notebook, navigate to the File | New menu option.
  2. In the input field of the first cell, enter a page title for this notebook. In this example, type in Welcome to Hello World.
  3. From the options toolbar menu, go to Cells | Cell Type and select Heading 1. This will format the text we have entered as the page title. The changes, however, will not be immediate at this time.
  4. From the options toolbar menu, go to Insert | Insert Cell Below. This will create another input cell below our current cell.
  5. In this example, we will insert the following piece of text that contains the Markdown code:
    Text Examples
    ===
    
    This is an example of an *italic* text.
    
    This is an example of a **bold*** text.
    
    This is an example of a list item:
    - Item #1
    - Item #2
    - Item #3
    
    ---
    
    #heading 1
    ##heading 2
    ###heading 3
    ####heading 4
    #####heading 5
    ######heading 6
  6. From the toolbar, select Markdown instead of Code.
  7. To run your code, go to Cell | Run All. This option will run all the Python commands and format your cells as required.

    Tip

    When the current cell is executed successfully, the notebook will focus on the next cell below, ready for your next input. If no cell is available, one will be automatically created and will receive the input focus.

This will give us the following output:

Creating a notebook with heading and Markdown cells

Saving notebooks

Go to File and click on Save and Checkpoint. Our notebook will be saved as an .ipynb file.

Mathematical operations in cells

Let's perform a simple mathematical calculation in the notebook; let's add the numbers 3 and 5 and assign the result to the answer variable by typing in the code cell:

answer = 3 + 5

From the options menu, go to Insert | Insert Cell Below to add a new code cell at the bottom. We want to output the result by typing in the following code in the next cell:

print answer

Next, go to Cell | Run All. Our answer is printed right below the current cell.

Mathematical operations in cells

Displaying graphs

The matplotlib module provides a MATLAB-like plotting framework in Python. With the matplotlib.pyplot function, charts can be plotted and rendered as graphic images for display in a web browser.

Let's demonstrate a simple plotting functionality of the IPython Notebook. In a new cell, paste the following code:

import numpy as np
import math
import matplotlib.pyplot as plt

x = np.linspace(0, 2*math.pi) 
plt.plot(x, np.sin(x), label=r'$\sin(x)$') 
plt.plot(x, np.cos(x), 'ro', label=r'$\cos(x)$') 
plt.title(r'Two plots in a graph') 
plt.legend() 

The first three lines of the code contain the required import statements. Note that the NumPy, math, and matplotlib packages are required for the code to work in the IPython Notebook.

In the next statement, the variable x represents our x axis values from 0 through 7 in real numbers. The following statement plots the sine function for every value of x. The next plot command plots the cosine function for every value of x as a dotted line. The last two lines of the code print the title and legend respectively.

Running this cell gives us the following output:

Displaying graphs

Inserting equations

What is TeX and LaTeX? TeX is the industry standard document markup language for math markup commands. LaTeX is a variant of TeX that separates the document structure from the content.

Mathematical equations can be displayed using LaTeX in the Markdown parser. The IPython Notebook uses MathJax to render LaTeX surrounded with $$ inside Markdown.

For this example, we will display a standard normal cumulative distribution function by typing in the following command in the cell:

$$N(x) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x} e^{- \frac{z^2}{2}}\, dz$$

Select Markdown from the toolbar and run the current cell. This will transform the current cell into its respective equation output:

Inserting equations

Besides using the MathJax typesetting, another way of displaying the same equation is using the math function of the IPython display module, as follows:

from IPython.display import Math
Math(r'N(x) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x} e^{- \frac{z^2}{2}}\, dz')

The preceding code will display the same equation, as shown in the following screenshot:

Inserting equations

Notice that, since this cell is run as a normal code cell, the output equation is displayed immediately below the code cell.

We can also display equations inline with text. For example, we will use the following code with a single $ wrapping around the LaTeX expression:

This expression $\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation

Run this cell as the Markdown cell. This will transform the current cell into the following:

Inserting equations

Displaying images

To work with images, such as JPEG and PNG, use the Image class of the IPython display module. Run the following code to display a sample image:

from IPython.display import Image
Image(url='http://python.org/images/python-logo.gif')

On running the code cell, it will display the following output:

Displaying images

Inserting YouTube videos

The lib.display module of the IPython package contains a YouTubeVideo function, where you can embed videos hosted externally on YouTube into your notebook. For example, run the following code:

from IPython.lib.display import YouTubeVideo

# An introduction to Python by Google.
YouTubeVideo('tKTZoB2Vjuk')  

The video will be displayed below the code, as shown in the following screenshot:

Inserting YouTube videos

Working with HTML

Notebook allows HTML representations to be displayed. One common use of HTML is the ability to display data with tables. The following code outputs a table with two columns and three rows, including a header row:

from IPython.display import HTML
table = """<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>"""
HTML(table)

The HTML function will render HTML tags as a string in its input argument. We can see the final output as follows:

Working with HTML

The pandas DataFrame object as an HTML table

In a notebook, pandas allow DataFrame objects to be represented as HTML tables.

In this example, we will retrieve the stock market data from Yahoo! Finance and store them in a pandas DataFrame object with the help of the panas.io.data.web.DataReader function. Let's use the AAPL ticker symbol as the first argument, yahoo as its second argument, the start date of the market data as the third argument, and the end date as the last argument:

import pandas.io.data as web
import datetime

start = datetime.datetime(2014, 1, 1)
end = datetime.datetime(2014, 12, 31)
df = web.DataReader("AAPL", 'yahoo', start, end)
df.head()

With the df.head() command, the first five rows of the DataFrame object that contains the market data is displayed as an HTML table in the notebook:

The pandas DataFrame object as an HTML table

Notebook for finance

You are now ready to place your code in a chronological order and present the key financial information, such as plots and data to your audience. Many industry practitioners use the IPython Notebook as their preferred editor for financial model development in helping them to visualize data better.

You are strongly encouraged to explore the powerful features the IPython Notebook has to offer that best suit your modeling needs. A gallery of interesting notebook projects used in scientific computing can be found at https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks.

Summary

In this chapter, we discussed how Python might be suitable for certain areas of finance and also discussed its advantages for our software applications. We also considered the functional programming paradigm and the object-oriented programming paradigm that are supported in Python, and saw how we can achieve brevity in our applications. There is no clear rule as to how one approach may be favored over the other. Ultimately, Python gives programmers the flexibility to structure their code to the best interests of the project at hand.

We were introduced to IPython, the interactive computing shell for Python, and explored its usefulness in scientific computing and rich media presentation. We worked on simple exercises on our web browser with the IPython Notebook, and learned how to create a new notebook document, insert text with the Markdown language, performed simple calculations, plotted graphs, displayed mathematical equations, inserted images and videos, rendered HTML, and learned how to use pandas to fetch the stock market data from Yahoo! Finance as a DataFrame object before presenting its content as an HTML table. This will help us visualize data and perform rich media presentations to our audience.

Python is just one of the many powerful programing languages that can be considered in quantitative finance studies, not limited to Julia, R, MATLAB, and Java. You should be able to present key concepts more effectively in the Python language. These concepts, once mastered, can easily be applied to any language you choose when creating your next financial application.

In the next chapter, we will explore linear models in finance and techniques used in portfolio management.

Left arrow icon Right arrow icon

Description

If you are an undergraduate or graduate student, a beginner to algorithmic development and research, or a software developer in the financial industry who is interested in using Python for quantitative methods in finance, this is the book for you. It would be helpful to have a bit of familiarity with basic Python usage, but no prior experience is required.

Who is this book for?

If you are an undergraduate or graduate student, a beginner to algorithmic development and research, or a software developer in the financial industry who is interested in using Python for quantitative methods in finance, this is the book for you. It would be helpful to have a bit of familiarity with basic Python usage, but no prior experience is required.

What you will learn

  • Perform interactive computing with IPython Notebook
  • Solve linear equations of financial models and perform ordinary least squares regression
  • Explore nonlinear modeling and solutions for optimum points using rootfinding algorithms and solvers
  • Discover different types of numerical procedures used in pricing options
  • Model fixedincome instruments with bonds and interest rates
  • Manage big data with NoSQL and perform analytics with Hadoop
  • Build a highfrequency algorithmic trading platform with Python
  • Create an eventdriven backtesting tool and measure your strategies

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 29, 2015
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781784394516
Category :
Languages :
Concepts :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Apr 29, 2015
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781784394516
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 120.97
Mastering Python for Finance
€41.99
Mastering R for Quantitative Finance
€41.99
Python for Finance
€36.99
Total 120.97 Stars icon

Table of Contents

11 Chapters
1. Python for Financial Applications Chevron down icon Chevron up icon
2. The Importance of Linearity in Finance Chevron down icon Chevron up icon
3. Nonlinearity in Finance Chevron down icon Chevron up icon
4. Numerical Procedures Chevron down icon Chevron up icon
5. Interest Rates and Derivatives Chevron down icon Chevron up icon
6. Interactive Financial Analytics with Python and VSTOXX Chevron down icon Chevron up icon
7. Big Data with Python Chevron down icon Chevron up icon
8. Algorithmic Trading Chevron down icon Chevron up icon
9. Backtesting Chevron down icon Chevron up icon
10. Excel with Python Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3
(7 Ratings)
5 star 14.3%
4 star 28.6%
3 star 28.6%
2 star 28.6%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Duncan W. Robinson Jun 14, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Wow… good stuff. Mastering Python for Finance really delivers. It does a fine job blending academic theory with a practitioner’s penchant for useful applications, delivering Python code all the way to guide the reader along his / her journey. I have not worked all of the examples yet, but I am looking forward to doing so – especially the sections that use Hadoop & Python together.
Amazon Verified review Amazon
Federico Han Feb 28, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
A pretty good survey on many object-oriented implementations common in Finance.Plenty of applications and examples -some indeed with errors , though on the positive it is a useful learning experience to do some minor debugging !-.As with many practical reference books try to buy the print version, this is not bedtime reading stuff.
Amazon Verified review Amazon
Kindleのお客様 Jul 06, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
金融工学の基礎を一通り習得した人が、pythonでコードをかけるようになるための一冊。目次の内容に対して、特に数学的な証明等なしで天下り的にPythonのコードが羅列されているので、ファイナンスの入門者にはお勧めしない。費用対効果は高い。
Amazon Verified review Amazon
Martin Galli Jan 01, 2017
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Bon livre en général mais dommage qu'il soit en Python 2.7 et non Python3.5. Sinon, les solutions sont très bien expliquées et l'organisation est claire.
Amazon Verified review Amazon
Ho Yan Chan May 02, 2018
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
ok
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.