Pandas and Polars¶
Under development
This lesson is part of the course scaffold and is being actively written. The learning objectives and outline below define its final scope.
Learning objectives¶
By the end of this lesson you will be able to:
- Index, slice, and align time-series DataFrames using a DatetimeIndex, including timezone handling and partial-date selection.
- Resample intraday data to arbitrary OHLCV bar frequencies and compute rolling-window statistics without introducing lookahead.
- Join price, reference, and fundamental datasets with correct as-of semantics and verify alignment.
- Translate a Pandas pipeline into a Polars lazy query and identify workloads where Polars outperforms Pandas.
Outline¶
- DataFrame and Series fundamentals — construction, dtypes, memory footprint
- Time-series indexing — DatetimeIndex, timezones, date-based slicing
- Resampling — OHLCV aggregation rules, bar boundaries, label alignment
- Rolling and expanding windows — moving statistics, min_periods, lookahead traps
- Joins and merges — inner/outer joins, merge_asof, alignment verification
- Polars lazy frames — expressions, query plans, predicate pushdown
- Pandas vs Polars — benchmarks, when each wins, migration patterns