A pricing or research script lives or dies on how numbers are stored, aligned and summarised. Syntax and a first contact with NumPy and pandas belong in the Python and Data Primer; this topic assumes that floor and treats the scientific stack as the engine room of a quantitative model: arrays as the numeric type, time-indexed tables as the market-data type, vectorised path and date arithmetic, and statistical summaries that match a named formula.
By the end of this note you should be able to:
- organise a small model script around NumPy arrays, a deliberate plot, and clear separation of data, parameters and results;
- replace path- or date-loops with broadcasting and matrix products when the algebra allows it, and recognise when a loop remains the right tool;
- build and validate a
DatetimeIndexpanel, align and resample without inventing returns, and choose simple versus log returns for the job at hand; - compute means, covariances and a least-squares fit as numerical stand-ins for named statistical objects, then check a simulation against a closed form.
In this lesson
- Contents
- The big picture
The full lesson is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or browse the Python for Quantitative Finance syllabus.