Contents

New: 40 Hands-On Polars Exercises for Financial Data Analysis

I’m excited to announce a major new addition to my data wrangling book: 40 exercises on stock data processing with Polars.

This hands-on guide walks you through real-world financial data manipulation using modern Polars syntax. You’ll work with actual CRSP stock market data (465k+ observations, 4,200+ stocks) covering daily prices, returns, trading volumes, and market caps.

The exercises progress from fundamental operations to advanced techniques:

  • Basics: Filtering, sorting, selecting columns, string operations
  • Aggregation: Group-by operations, pivoting, window functions
  • Time Series: Rolling calculations, lagged values, ranking over time
  • Advanced: Linear regression, alpha calculation, industry-adjusted returns, momentum strategies

Each exercise includes detailed explanations and complete solutions with step-by-step breakdowns.

If you’re still using Pandas, it’s time to consider Polars. It’s 5-10x faster on typical data tasks, with:

  • Automatic parallel execution across all CPU cores
  • Lazy evaluation for query optimization
  • Clean, expressive method-chaining API
  • Strict type system that catches errors early
  • Better memory management with Apache Arrow

For data-intensive research and analysis, Polars is simply the superior choice in 2026.

This guide is designed for:

  • Business and finance students learning data analysis
  • Researchers working with financial datasets
  • Anyone transitioning from Pandas to Polars
  • Python users who want to level up their data manipulation skills

Check out the full guide at data-book.netlify.app/pl-practice.

The exercises are self-contained and can be worked through at your own pace. Whether you’re new to Polars or looking to sharpen your skills with practical examples, this guide has something for you.

Happy data wrangling!