Why Polars is becoming the best tool for market data analysis

By PyQuant News

Published: 2026-09-19

URL: https://pyquantnews.substack.com/p/where-458-milliseconds-actually-go


Each week, I send out one Python tutorial to help you get started with algorithmic trading, market data analysis, and quant finance. Upgrade to a paid plan to access the Python code notebooks, Discord community, and code support.

Subscribe now


My notebook spent most of its time reading one CSV file, not running my code.

Questions in my community of 1,700 people almost always start with a pandas DataFrame. Zipline Reloaded and PyFolio both hand back pandas objects, so pandas looks like the only option. Polars reads the same CSV file with pl.read_csv and finishes in single-digit milliseconds.

I restarted the kernel, waited on that same read_csv cell again, and never got to the second moving average idea.

Where the time goes

I pulled daily prices from 1994 through 2024 for the S&P 500’s current 500 members, one row per ticker per day. That CSV holds about 3.8 million rows, and pd.read_csv averaged 458 milliseconds across repeated runs after a kernel restart.

Students in my course reload the same CSV file (a plain text table of data) after every kernel restart without ever timing it.

So I timed each step, found the read was the slowest one, and swapped only that single call for Polars.

What you’ll build

In today’s post, you’ll time pandas against Polars on eight tasks, from read_csv through filters and per-ticker returns.

Let’s go.