# 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 with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-16, pandas-dev/pandas contains 349,365 total lines (295,098 code) across 460 files, while pola-rs/polars contains 579,400 total lines (504,853 code) across 2,304 files as of 2026-09-16. pola-rs/polars is about 1.7x the size of pandas-dev/pandas by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [pandas-dev/pandas](https://octocounts.com/github/pandas-dev/pandas) | [pola-rs/polars](https://octocounts.com/github/pola-rs/polars) |
| --- | ---: | ---: |
| Files | 460 | 2,304 |
| Total lines | 349,365 | 579,400 |
| Code lines | 295,098 | 504,853 |
| Comment lines | 20,584 | 16,743 |
| Blank lines | 33,683 | 57,804 |
| Languages counted | 11 | 9 |

Top languages in pandas-dev/pandas: Python (79.5% of code), Cython (15.3% of code), C (2.2% of code). Top languages in pola-rs/polars: Rust (76.7% of code), Python (22.1% 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 f60d9048ca5983075b493bc5d827b83e11735af0 (commit f60d9048ca59) on 2026-09-16; pola-rs/polars was counted at ref 3127ec9c82e05846a6194db7d2e3b996eda79529 (commit 3127ec9c82e0) on 2026-09-16. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

pandas-dev/pandas counts the pandas repository: the Python DataFrame library, its Cython/C extension sources, tests, and documentation. pola-rs/polars counts the Polars repository: the Rust core of the DataFrame engine plus its language bindings, including the Python bindings most users install. Both counts 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](https://github.com/pandas-dev/pandas) · [pola-rs/polars repository (Rust core with language bindings)](https://github.com/pola-rs/polars). Statements verified 2026-09-16.

Evidence and next steps:

- [pandas-dev/pandas SLOC report](https://octocounts.com/github/pandas-dev/pandas)
- [pola-rs/polars SLOC report](https://octocounts.com/github/pola-rs/polars)
- [Compare pandas-dev/pandas and pola-rs/polars interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fpandas-dev%2Fpandas&right=https%3A%2F%2Fgithub.com%2Fpola-rs%2Fpolars)

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?

pola-rs/polars has more code: 504,853 code lines versus 295,098 for pandas-dev/pandas, about 1.7x as much, based on cached OctoCounts reports as of 2026-09-16.

### 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 f60d9048ca5983075b493bc5d827b83e11735af0 (commit f60d9048ca59) on 2026-09-16; pola-rs/polars was counted at ref 3127ec9c82e05846a6194db7d2e3b996eda79529 (commit 3127ec9c82e0) on 2026-09-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.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
