NumPy vs SciPy: source lines of code compared

The NumPy vs SciPy comparison on OctoCounts shows side-by-side source line counts for numpy/numpy and scipy/scipy, 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 numpy/numpy and scipy/scipy 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-16, numpy/numpy contains 613,105 total lines (455,816 code) across 948 files, while scipy/scipy contains 697,866 total lines (538,321 code) across 1,320 files as of 2026-11-16. scipy/scipy has about 1.2x the counted code lines of numpy/numpy 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.

Metricnumpy/numpyscipy/scipy
Files9481,320
Total lines613,105697,866
Code lines455,816538,321
Comment lines104,11190,379
Blank lines53,17869,166
Languages counted2217

Top languages in numpy/numpy: Python (46.3% of code), C (37.3% of code), C Header (6.9% of code). Top languages in scipy/scipy: Python (56.1% of code), C (20.2% of code), C++ (8.5% of code). Python, C, C Header, C++, Cython appear in both top language lists.

Methodology: both counts come from cached OctoCounts reports generated with tokei. numpy/numpy was counted at ref main (commit fcb01c9e164b) on 2026-11-16; scipy/scipy was counted at ref main (commit 287d3f491413) 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. numpy/numpy: 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. scipy/scipy: 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: numpy/numpy is the NumPy repository — the ndarray implementation, its Python and C layers, tests, and documentation. scipy/scipy is the SciPy repository — a library of scientific computing modules (optimization, integration, signal processing, and others) built on top of the array model NumPy provides. Both are scientific-Python library trees, counted on the dates in the methodology line.

The per-language tables of both reports show the two-layer implementation typical of scientific Python: Python as the dominant counted language with C underneath for the numerically hot paths of each library.

SciPy's tree spans many distinct submodules — one per problem domain — while NumPy's tree is organized around a single core array object and its operations, so the totals reflect breadth of scope versus depth of one abstraction.

Line counts do not measure numerical performance or accuracy: those depend on the shipped release, the underlying compiled routines, and how a workload uses them — not on the size of either source tree.

Sources: numpy/numpy repository · scipy/scipy repository. 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, numpy/numpy or scipy/scipy?

As of 2026-11-16, numpy/numpy contains 613,105 total lines (455,816 code) across 948 files, while scipy/scipy contains 697,866 total lines (538,321 code) across 1,320 files as of 2026-11-16. scipy/scipy has about 1.2x the counted code lines of numpy/numpy 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 numpy/numpy, scipy/scipy, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. numpy/numpy was counted at ref main (commit fcb01c9e164b) on 2026-11-16; scipy/scipy was counted at ref main (commit 287d3f491413) 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.