Skip to content
Python and Data Primer / Financial Data Access

Time-Series Data

Two prices can be compared only after their dates, time zones and sampling intervals are understood. This lesson builds a sorted time index, checks duplicates and combines observations by timestamp. It then resamples prices with an explicit rule. Start with pandas for labelled tables; use API checks when the observations come from a service.
Learning objectives. By the end of this note you should be able to parse timestamps, sort and test uniqueness, localise a time zone, align series and resample with an explicit aggregation rule.

In this lesson

  1. Build a valid time index
  2. Align before combining
  3. Resample with a stated rule
  4. A weekly label can contain an incomplete week

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 and Data Primer syllabus.