Skip to content
Python for Quantitative Finance / Scientific Python and data

Scientific Python

A pricing script must keep market inputs, model parameters, calculations and reports easy to trace. NumPy arrays represent the numerical objects; pandas tables retain data labels; figures communicate results. This lesson organises those parts so later vectorisation and numerical tests use clear inputs and outputs.
Learning objectives. By the end of this note you should be able to:
  • state why a homogeneous array, not a nested list, is the numeric type for path and portfolio arithmetic;
  • sketch a four-block script layout (inputs → transform → compute → report) for a small model;
  • produce one correctly labelled figure that answers a single research question;
  • point at the primer for loops, functions and first-contact NumPy instead of reteaching them.

In this lesson

  1. NumPy is the numeric type
  2. A model script has four blocks
  3. One plotting choice, one question
  4. Organising imports and dependencies
  5. From script to package — later
  6. Shape checks at every boundary
  7. A worked micro-script

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Python for Quantitative Finance syllabus.