# Python for Quants

### REGISTRATION | PRICING | GENERAL COURSE INFORMATION

Python for Quants is geared toward financial analysts who would like to learn how to use Python in their day-to-day work. Exercises include filtering and plotting an array of Dow Jones closing data, calculating options pricing using Black-Scholes models, estimating volatility using GARCH, and using a Monte Carlo simulation to calculate an option price.

###### TARGET AUDIENCE

Programming experience in some language (C, VB, Fortran, Matlab) is expected. Experience with C, C++, and/or Fortran is useful for some topics. Object oriented programming skills are not necessary but will be helpful. Knowledge of calculus, statistics, and optimization, are all valuable but not absolutely required.

###### COURSE TOPICS

Day 1

8:30 am to 5:00 pm

###### Python

The first day is devoted to understanding how to think in Python. We start by demonstrating the IPython interactive environment and how it can be used for rapid application development. The pace of this day is determined by previous exposure to Python. Even experienced Python programmers report learning new ideas from the experts that teach this course.

- Data-types (strings, lists, dictionaries, files)
- Syntax and language structure
- Creating and importing modules
- Reading and writing files
- Overview of the standard library
- Introduction to object oriented programming

Day 2

8:30 am to 5:00 pm

###### NumPy

On the second day, the NumPy extension module to Python is exposed as a tool for rapidly manipulating and processing large data-sets.

- Basic operations and manipulations on N-dimensional arrays
- Understanding the N-dimensional data structure
- Using vectorization to process arrays with implicit loops
- Understanding slicing and broadcasting
- Dealing with large data-sets
- Working with “structured” arrays
- Reading and writing data
- Filtering and plotting an array of Dow Jones closing data

Day 3

8:30 am to 5:00 pm

###### SciPy and extension modules

- Overview of SciPy with examples chosen according to attendees' needs (interpolation, curve-fitting, optimization, etc.)
- Creating Extension modules
- Interacting with other languages: Weave, Cython, SWIG, f2py
- Calculating options pricing using Black-Scholes models
- Estimating volatility using GARCH
- Calculating implied volatility for Black-Scholes models
- Using a Monte Carlo simulation to calculate an option price

**Days 4 and 5 are for the London class only**

Day 4

8:30 am to 5:00 pm

###### Interfacing with C / C++ and Fortran

One of Python’s greatest features is its ability to integrate seamlessly with C, C++, and Fortran. In this module you will learn how to use a variety of tools that have emerged for efficiently integrating with legacy code as well as optimizing new code with compiled modules. This module extends the material covered on the third day of the Python for Scientists and Engineers course. Topics to be covered can be modified to suit participants interest but can include:

- Integrating with Fortran using f2py
- Integrating legacy C / C++ code using SWIG
- In-lining C/C++ in a Python application using Weave
- Calling arbitrary shared-libraries with ctypes
- Creating new extension modules with Cython

Day 5

8:30 am to 5:00 pm

###### Introduction to UIs and Visualization

This one day course is a condensed version of portions of the 3-day course which covers just the basics of Traits and Chaco. Students will learn the basics of Traits and how to build simple interactive visualizations with Chaco. Topics included:

Traits

- Notification
- Visualization
- Validation
- Initialization
- Delegation

Chaco

- Integration into Traits UI
- Scatter and line plots
- Image plots
- Containers for layout
- Simple tool creation for event handling
- Introduction to overlays