pandas vs Polars: source lines of code compared

The pandas vs Polars comparison on OctoCounts shows side-by-side source line counts for pandas-dev/pandas and pola-rs/polars, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

This page compares the source lines of code (SLOC) of pandas-dev/pandas and pola-rs/polars using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-11-15, pandas-dev/pandas contains 361,240 total lines (305,184 code) across 467 files, while pola-rs/polars contains 684,194 total lines (599,000 code) across 2,468 files as of 2026-11-16. pola-rs/polars has about 2.0x the counted code lines of pandas-dev/pandas under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricpandas-dev/pandaspola-rs/polars
Files4672,468
Total lines361,240684,194
Code lines305,184599,000
Comment lines21,70019,687
Blank lines34,35665,507
Languages counted118

Top languages in pandas-dev/pandas: Python (79.8% of code), Cython (15.0% of code), C (2.1% of code). Top languages in pola-rs/polars: Rust (78.6% of code), Python (20.3% of code), TOML (0.9% of code). Python appears in both top language lists; Cython, C, Autoconf, C++ appear only in pandas-dev/pandas's top languages; Rust, TOML, Makefile, Nix appear only in pola-rs/polars's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. pandas-dev/pandas was counted at ref main (commit 90acce7c7cb3) on 2026-11-15; pola-rs/polars was counted at ref main (commit 812ee9c9e09e) on 2026-11-16. See the counting methodology for ignored directories and analysis options.

Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. pandas-dev/pandas: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. pola-rs/polars: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.

About this comparison

Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: pandas-dev/pandas is the pandas repository: the Python DataFrame library, its Cython/C extension sources, tests, and documentation. pola-rs/polars is the Polars repository: the Rust core of the DataFrame engine plus its language bindings, including the Python bindings most users install. Both repositories were taken on the dates shown in the methodology line above.

The per-language tables tell the implementation split directly: pandas is a predominantly Python codebase with Cython/C extension code beneath it, while Polars's counted code is dominated by Rust, with Python mainly present in the bindings layer.

The Polars repository bundles bindings for several languages alongside the Rust core, so not every counted line belongs to the engine a given user imports — the per-language table helps separate core from bindings.

These counts do not measure query speed, memory use, or which library fits a workload; performance is a property of the shipped binaries and the query being run, not of the source trees' line counts.

Sources: pandas-dev/pandas repository · pola-rs/polars repository (Rust core with language bindings). Statements verified 2026-09-16.

Evidence and next steps:

Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, pandas-dev/pandas or pola-rs/polars?

As of 2026-11-15, pandas-dev/pandas contains 361,240 total lines (305,184 code) across 467 files, while pola-rs/polars contains 684,194 total lines (599,000 code) across 2,468 files as of 2026-11-16. pola-rs/polars has about 2.0x the counted code lines of pandas-dev/pandas under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for pandas-dev/pandas, pola-rs/polars, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. pandas-dev/pandas was counted at ref main (commit 90acce7c7cb3) on 2026-11-15; pola-rs/polars was counted at ref main (commit 812ee9c9e09e) on 2026-11-16. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.