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
- Build a valid time index
- Align before combining
- Resample with a stated rule
- 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 lessonNew to SelfMadeQuant.com? See membership options or browse the Python and Data Primer syllabus.