Instructor-led training
Python for Finance Training in Berwick, Pennsylvania
This course begins with an abbreviated primer on Python (language syntax, data structures, basic data processing, Python functions, modules and classes).
What you'll learn
Private Training for Teams
This course is offered as private, instructor-led training for organizations, onsite in Berwick, Pennsylvania or live online. Dates, delivery format, and course content are arranged around your team's requirements.
This course is not currently scheduled as a public class for individual enrollment.
Request Group TrainingPrerequisites
Course Outline
The course is taught over four days and covers the Python language and critical library modules for finance and engineering, including data visualization.
Introduction to Python.
The first section of the course is an introduction to the Python programming language. It introduces the details of how to start and stop the interpreter and write programs, and explains basic data-types, files, functions, and error handling.
Working with Data.
Section 2 provides a detailed tour of how to represent and work with data in Python. It covers tuples, lists, dictionaries, and sets, as well as NumPy arrays. Students will learn the critical aspects of Python's underlying object model including variables, reference counting, copying, and type checking and how to effectively use Python's very powerful list processing primitives. More information about how to organize larger programs into functions is provided in Section 3. A major focus is placed on design functions and the technical details of functions, including scoping rules and documentation strings.
Program Organization and Functions
More information about how to organize larger programs into functions is provided in Section 3. A major focus is placed on design functions and the technical details of functions, including scoping rules and documentation strings.
Modules and Libraries.
Section 4 addresses how to organize programs into modules and use those modules as a tool for creating extensible programs. It concludes with a tour of some of the most commonly used library modules including those related to system administration, text processing, subprocesses, XML parsing, binary data handling, and databases.
Classes and Objects.
In Section 5, students are given an introduction to object-oriented programming in Python. Topics such as how to create new objects, overload operators, and utilize Python special methods will be explained, along with the basic principles of object oriented programming including inheritance and composition.
NumPy.
NumPy is Python's array and mathematics library. Section 6 covers how one can and should use NumPy to simplify and speed up code. It starts with a brief overview of NumPy's memory model and teaches ways to slice and dice data using NumPy's sophisticated indexing operations. Mathematical use cases, various interpolation functions, matrix decompositions, computing eigenvalues, solving systems of equations and inverting matrices are also covered.
SciPy.
SciPy is Python's scientific complement to NumPy. SciPy is quite broad and used in many different domains. Section 7 covers key areas relevant to finance, starting with SciPy's statistical functions, how to generate different distributions and perform statistical computations. It also covers some interpolation, linear algebra, optimizations, signal processing, and fourier transforms. These are useful in efficiently computing some moving window functions (moving averages, exponential moving averages, bollinger bands).
Pandas.
Pandas is Python's answer to the R dataframe, which provides a very convenient way to work with tabular data. It helps organize your data by handling missing data and data alignment automatically. In Section 8, students learn about Pandas ability to do simple olap aggregations and drill downs without additional code, as well as executing efficient computations for statistical functions, like moving window functions and rolling regressions.
Integrating with Native Code.
Python is fantastic, but often we have to work with code in existing C/C++ libraries. One of the easiest ways to do this is with Python's built-in ctypes libraries, or if you can invest a little more, Cython - a Python to C compiler. Cython can be used to speed up Python code dramatically. In Section 9, students will examine several use cases that show how to write Python code first and optimize for speed later.
Production Python in Finance.
Python is fantastic for data analysis. One key feature allows users to go from quantitative analysis to a production application extremely rapidly. In Section 10, students will learn either how to wrap Python analysis code up in a web application for effortless deployment or to script in Excel using Python.
Numerical Optimization. One reason that quants love Matlab is that it makes it very easy to solve numerical optimization problems. We cover the main optimization libraries so you know what's out there, as well as teach you how to use them to solve real world problems.
Data Visualization.
Matplotlib is a Python visualization library which makes it easy to generate static plots. Section 12 will show students how to use Matplotlib to create basic line plots, scatter plots, density estimation plots, as well as date handling. If you have any specific plotting requirements, let us know and we can cover those use cases as well.
What makes this material hard to master
The course covers a lot in four days: a language primer, the numerical stack, performance work, and delivery. The difficulty is less any single library than keeping a mental model that holds across all of them.
- The object model comes first, and it matters later. The syllabus covers variables, reference counting, copying and type checking before any numerical work. Aliasing and copy-versus-view behavior are the usual source of silent errors once data moves into NumPy arrays and Pandas structures.
- Array thinking replaces loop thinking. The NumPy section starts with the memory model and indexing, then moves to interpolation, matrix decompositions, eigenvalues, linear systems and inversion. Code that works but loops element by element is the typical habit to unlearn.
- Statistics and signal tools overlap. SciPy is used for distributions, statistical computation, optimization, and Fourier transforms. The syllabus ties the transforms to moving-window calculations such as moving averages, exponential moving averages and Bollinger bands. Pandas then offers the same family of calculations, plus rolling regressions, with automatic data alignment and missing-data handling. Knowing which tool to use, and what alignment does to your results, takes practice.
- Optimization is about choosing a method. The course surveys the main optimization libraries and applies them to practical problems. Formulating the problem is usually harder than calling the solver.
- Performance work has its own rules. ctypes and Cython are presented as a write-it-in-Python-first, optimize-later approach. This requires knowing where the time goes before changing anything.
Who it suits and what to take around it
The course is aimed at quantitative analysts and technology staff who want to prototype faster. Because the syllabus begins with starting the interpreter, basic data types, files, functions and error handling, it does not assume prior Python. Even so, the pace over four days suits people who already program in some language or work with numerical data. Anyone who wants a slower start on the language can first take Introduction to Python 3.x, which gives more time to the fundamentals this course covers in its primer.
For more depth on tabular and array work after this course, Python Data Analysis with NumPy and Pandas is a focused companion to the NumPy and Pandas sections. Other options are listed in the Python Programming courses and learning guide.
Organizations whose teams use a particular Python or library version can ask about private training tailored to those versions via a training proposal.
Illustrative scenarios
The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.
- Rolling statistics on a price series. An analyst might load tabular price data into Pandas, align it with a second series, handle gaps, and compute moving averages, exponential moving averages and a rolling regression, then plot the result with Matplotlib, including date handling.
- Reusing an existing native library. A team might have a C/C++ calculation library it cannot rewrite. For example, it could call the library through ctypes, then use Cython on the slowest Python-side loop once profiling shows where the time is spent.
- Fitting and delivering a model. A quant might use an optimization library to calibrate parameters, then deliver the result either by scripting it from Excel with Python or by wrapping the analysis in a web application, the two production routes the syllabus describes.
AI coding assistants for these topics
AI coding assistants are useful for drafting boilerplate: file-reading scripts, Matplotlib plotting code, basic Pandas transformations and unit tests. They also help explain unfamiliar library calls.
They are less reliable where the topics here depend on subtle numerical or low-level behavior:
- Shapes and broadcasting. Generated NumPy code may run without error yet produce the wrong dimensions or an unintended view or copy.
- Rolling windows and alignment. Generated Pandas code can misalign series, mishandle missing data, or let a window include values it should not see.
- Optimization. An assistant may pick a solver or constraint form that does not suit the problem, or ignore convergence status.
- Native code. ctypes argument types and Cython declarations are easy to get subtly wrong, and mistakes may only show up as crashes or bad values.
To verify, test on small inputs with known answers (or closed-form results), compare vectorized output with a simple loop version, check shapes and edge cases such as empty or missing data, check solver status and the objective value, and benchmark before and after any speedup. Review generated code before it is used in an automated business process.
Frequently asked questions
What level is Python for Finance?
It is a general-level, four-day course for quantitative analysts and technology staff. It starts with a Python primer and then moves into NumPy, SciPy, Pandas, optimization, native-code integration and visualization.
Do I need to know Python beforehand?
The syllabus begins with the basics of the interpreter, data types, functions and error handling, so prior Python is not assumed. Prior programming or numerical work will help you keep up with the pace.
What does the course cover?
Python language and data structures, modules and classes, NumPy, SciPy statistics and moving-window functions, Pandas aggregation and rolling calculations, ctypes and Cython, production delivery through a web application or Excel scripting, numerical optimization, and Matplotlib plotting.
Can this be delivered privately, onsite or online?
Yes. HSG delivers private training for organizations either at the client's location or live online.
Can the content be customized?
Private courses can be customized, including to the technology versions and specific plotting or analysis needs of your team. Request a training proposal to discuss it.
Training locations
Python for Finance training across the U.S. and beyond.
We provide private Python for Finance training for organizations, onsite at your location or live online, throughout the United States and internationally.
View all Python for Finance training locations
Train your team with HSG
Private, instructor-led training customized for your organization.
- Onsite or live online delivery
- Customized curriculum
- For a single employee or an entire team
- Flexible scheduling
- Experienced instructors
Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com
Ready to train your team?
Let's customize this training for your organization.
Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.