Python for Finance
This is a course for financial analysts, traders, risk analysts, fund managers, researchers, data scientists, statisticians, and software developers.
Some familiarity with programming concepts (in any language) is assumed.
By the end of the course, you will have all the knowledge you need to start using Python competently for processing, analysing, modelling, and visualising financial data, with a focus on time series. You will have had experience with using Python for various scripting, data-manipulation and visualisation tasks with data in a variety of formats, including SQL databases, CSV, Excel spreadsheets, JSON, and API endpoints. You will know how to slice, dice, merge, aggregate, pivot, clean, munge, resample, and plot financial time-series data with ease. You will understand the elegance and power of the Python language and its powerful ecosystem of packages for finance and data analytics, and you will be well-placed to continue learning more as you use it day-to-day.
Day 1: Python Basics
Day 1 covers how to use Python for basic scripting and automation tasks, including tips and tricks for making this easy. The syllabus is as follows:
- Why use Python? What’s possible?
- The Jupyter notebook for rapid prototyping
- Modules and packages
- Python concepts: an introduction through examples
- Essential data types: strings, tuples, lists, dicts
- Worked example: fetchind and ranking real-time data from a web API
- Raising and handling exceptions
Day 2: Handling, analyzing and presenting data in Python
Python offers amazingly productive tools like Pandas for working with different kinds of data. Day 2 gives a thorough introduction to analyzing and vis- ualizing data easily. You will learn how to slice, dice, merge, aggregate, pivot, clean, munge, resample, and plot data with ease:
- Reading and writing essential financial data formats: CSV, Excel, SQL, JSON, time-series (others on request)
- Indexing and selecting data in Pandas
- Data fusion: joining & merging datasets
- Summarizing data with "group by" operations; pivot tables
- Visualization and statistical graphics with Seaborn
- Creating automated reports from Jupyter notebooks
Day 3: Time-series, simulation, inference and modelling
Day 3 demonstrates more advanced features of Pandas for working with data, including time-series data. It then describes Monte Carlo simulation methods and walks you through using powerful methods of inference and modelling for different kinds of data in Python:
- Time-series analysis: parsing dates, resampling
- Introduction to NumPy for manipulating vector and matrix data: data types, powerful indexing, reshaping, ufuncs
- Classical statistics: Monte Carlo simulation and linear regression with scipy.stats and statsmodels
- Density estimation with scikit-learn
- Dimensionality reduction with PCA
Day 4: Machine learning
Day 4 introduces a more automated approach to modelling real-world data with several powerful machine learning algorithms using scikit-learn. The da- tasets are selected from a range of industries: financial, geospatial, medical, and social sciences:
- Concepts of machine learning (ML)
- Overview of the ML package ecosystem in Python
- Classification with scikit-learn: Naive Bayes, logistic regression, SVMs, random forests Application to diagnosis, AI systems, and time-series prediction
- Nonlinear regression, with application to forecasting
- Clustering data with DBScan, with application to outlier detection
- Validation and model selection; feature selection
- Deploying machine learning models in production
Day 5: Handling financial time-series in depth
Day 5 teaches you in-depth about munging, modelling, and visualization of financial time-series data in Python:
- Secret weapons in Pandas: handling time-zones, searchsorted, hierarchical indices, unstack, styles
- Common time-series models in Python: AR, ARIMA
- Simulation examples: Monte Carlo risk analysis; Black-Scholes pricing
- Handling missing data and outliers; outlier detection with clustering
- Visualizing time-series data interactively with Altair
- 2-way integration of Python with Excel using xlwings
- Examples: running Monte Carlo risk simulations with Python and Excel
We also encourage you to bring your own data sets to the course where relevant.
We will supply you with printed course notes, cheat sheets, and a USB stick containing kitchen-sink Python installers for multiple platforms, solutions to the programming exercises, several written tutorials, and reference documentation on Python and the third-party packages covered in the course.
- Personal help:
- Your trainer(s) will be available after the course each day for you to ask any one-on-one questions you like — whether about the course material and exercises or about specific problems you face in your work and how to use Python to solve them.
- Food and drink:
- We will provide lunch, morning and afternoon tea, and drinks.
- The course will run from 9:00 to roughly 17:00 each day, with breaks of 45 minutes for lunch and 15 minutes each for morning and afternoon tea.
Python for Finance:
440 Collins Street (Level 1), Melbourne CBD
18 Nov – 22 Nov 2019