Vous êtes sur la page 1sur 6

8/2/2019 01_overview.

md · GitHub

Instantly share code, notes, and snippets.

yhilpisch / 01_overview.md
Last active 9 months ago

Embed <script src="https://gist Download ZIP

01_overview.md

Intermediate Python for Finance Training


This is the Gist for the Intermediate Python for Finance Training in London, 28.-29. November 2017.

Notebooks & Code Files


Additional files (eg Jupyter Notebooks) are found under:

https://gist.github.com/d06a4e0987e45c0a8219136f027c3769 (day 1)

https://gist.github.com/26b02c85c5d3b67034bd55b29e12e549 (day 2)

Slides
http://hilpisch.com/intpython.pdf

Python Cheat Sheets


Python: https://s3.amazonaws.com/assets.datacamp.com/blog_assets/PythonForDataScience.pdf
NumPy: https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Numpy_Python_Cheat_Sheet.pdf
pandas: https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Python_Pandas_Cheat_Sheet_2.pdf
SciPy: https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Python_SciPy_Cheat_Sheet_Linear_Algebra.pdf
matplotlib: https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Python_Matplotlib_Cheat_Sheet.pdf

Recommended Books
Matt Harrison (2017): Illustrated Guide to Python 3.
Luciano Ramalho (2015): Fluent Python. O'Reilly.
Jake VanderPlas (2016): Python Data Science Handbook. O'Reilly.
Gael Varoquaux et al. (2017): SciPy Lecture Notes. http://www.scipy-lectures.org/

https://gist.github.com/yhilpisch/1fb0b9a3da5f29a419ed72d8b5a8d019 1/6
8/2/2019 01_overview.md · GitHub

The Python Quants


http://twitter.com/dyjh

team@tpq.io | http://tpq.io

http://pyalgo.tpq.io | http://certificate.tpq.io

02_program_overview.md

Program Overview
The training is over two days, with a total of four modules and eight sections.

Every section is about 90 minutes long, followed by a short break or a longer (lunch) break.

The style of the training is interactive throughout, meaning that the material is developed live during the sections.

The participants will also work on exercises related to the topics of the singe sections.

Day 1

Module 1 — Python
This module is a review of Python infrastructure elements and basic Python idioms.

The goal of this module is to be able to set up a proper Python environment, to know about basic tools and to be aware of basic
Python functionality.

Module 2 — NumPy
This module covers numerical operations and algorithms with NumPy for finance.

NumPy is a central package in numerical and financial analysis. It allows for the performant implementation of financial
algorithms based on concise, vectorized code.

The goal of this module is to understand the benefits of NumPy compared to pure Python code in finance.

Day 2

Module 3 — pandas
This module is about data analysis and visualization with pandas for finance.

pandas has become the central data analysis tool in the Python ecosystem. It is powerful, among others, in handling financial
time series data, in visualizing such data and implementing algorithms on such data sets.

The goal of this module is to be aware of the capabilities of pandas and to be able to apply pandas to typical financial analytics
tasks.

Module 4 — OOP
The final module addresses object-oriented programming (OOP) in Python based on finance examples.

https://gist.github.com/yhilpisch/1fb0b9a3da5f29a419ed72d8b5a8d019 2/6
8/2/2019 01_overview.md · GitHub
OOP is a powerful programming paradigm with many benefits over simple procedural implementations. Among others, it
allows a simplified modeling of real-world and financial object, to avoid redundancies, to simplify code maintenance and re-
usability.

The goal of this module is to be aware of basic OOP features in Python and to implement financial algorithms in a re-usable
fashion.

The Python Quants


http://twitter.com/dyjh

team@tpq.io | http://tpq.io

http://pyalgo.tpq.io | http://certificate.tpq.io

03_python_envs.md

Setting up a Python Environment

Windows

Miniconda
How to install Miniconda:

https://conda.io/docs/user-guide/install/windows.html

The installer is found under:

https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe

Python
See http://conda.io

Also see https://conda.io/docs/_downloads/conda-cheatsheet.pdf

And: https://conda.io/docs/user-guide/tasks/manage-environments.html

To create an environment execute in the terminal ("command prompt"):

conda create -n base python=3.6


activate base

To install Python packages and start Jupyter execute in the terminal:

conda install ipython jupyter numpy pandas scikit-learn matplotlib pytables


pip install win-unicode-console
set PYTHONIOENCODING=UTF-8
jupyter notebook

Mac OS

https://gist.github.com/yhilpisch/1fb0b9a3da5f29a419ed72d8b5a8d019 3/6
8/2/2019 01_overview.md · GitHub

System
For installing the brew package manager, follow the instructions under:

https://brew.sh/

Installing system tools in a terminal/on the shell:

brew install wget htop screen [MORE IF NEEDED]

Miniconda
To download and install it:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash miniconda.sh

Open new terminal to activate the Python installation.

Python
See http://conda.io

Also see https://conda.io/docs/_downloads/conda-cheatsheet.pdf

To create an environment execute:

conda create -n base python=3.6


source activate base

To install Python packages and start Jupyter execute in the terminal:

conda install ipython jupyter numpy pandas scikit-learn matplotlib pytables


jupyter notebook

Linux

System
Doing system updates and installing system tools in the terminal/on the shell:

apt-get update
apt-get upgrade
apt-get install wget bzip2 screen vim gcc [MORE IF NEEDED]

Miniconda
To download and install it:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh


bash miniconda.sh

Open a new terminal/shell instance to activate the Python installation.

Python
See http://conda.io

Aslo see https://conda.io/docs/_downloads/conda-cheatsheet.pdf

To create an environment execute:

https://gist.github.com/yhilpisch/1fb0b9a3da5f29a419ed72d8b5a8d019 4/6
8/2/2019 01_overview.md · GitHub

conda create -n base python=3.6


source activate base

To install Python packages and start Jupyter execute in the terminal:

conda install ipython jupyter numpy pandas scikit-learn matplotlib pytables


jupyter notebook

The Python Quants


http://twitter.com/dyjh

team@tpq.io | http://tpq.io

http://pyalgo.tpq.io | http://certificate.tpq.io

04_docker_basics.md

Some Docker Basics


[As an alternative to using the local operating system.]

Installation
Detailed installation instructions are found under:

https://docs.docker.com/engine/installation/

Linux/Mac
To test whether it is installed, open a terminal window and type:

docker version

To run a docker container, type for instance:

docker run -ti -h fpq -p 8888:8888 ubuntu:latest /bin/bash

Windows
Open the Docker Quickstart Terminal.

To run a docker container type:

docker run -ti -h fpq -p 8888:8888 -e MACHINE_IP=$(docker-machine ip) ubuntu:latest /bin/bash

The Python Quants

https://gist.github.com/yhilpisch/1fb0b9a3da5f29a419ed72d8b5a8d019 5/6
8/2/2019 01_overview.md · GitHub
http://twitter.com/dyjh

team@tpq.io | http://tpq.io

http://pyalgo.tpq.io | http://certificate.tpq.io

https://gist.github.com/yhilpisch/1fb0b9a3da5f29a419ed72d8b5a8d019 6/6

Vous aimerez peut-être aussi