Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

NumPy

Fast math on lots of numbers in Python.

ML and data sciencePYPI

GitHubWebsite

1. License

“Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met”

Paid and closed-source products may use NumPy; no fee and no credit on screen is needed.

github.com/numpy/numpy/blob/main/LICENSE.txt

From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What NumPy does

NumPy is a free Python library that does math on thousands or millions of numbers at once. Your app or your AI assistant's script can get averages and percentiles, draw random samples and compare AI text vectors in a few lines. Most Python data and AI libraries take and return NumPy arrays.

What people build with it

Rank search results by meaning Idea

Your app turns each document and the user's question into an AI text vector; NumPy scores every document against the question and returns the closest ones.

Summarise numbers from your logs

Turn a column of page load times or order totals into a median, a 95th percentile and a count of outliers for a status page or a report.

Pick a fair random test group

Choose 500 users for a new feature or make test data, and get the same picks again next time by fixing the seed.

Keep computed vectors in a file

Save thousands of AI text vectors to one file after computing them once, and load them back in a moment on the next start.

Hand data to other libraries

pandas tables, scikit-learn models, image tools and chart libraries all read NumPy arrays, so one format moves through the whole data script.

Edit pictures as grids of numbers Idea

Load a photo with an image library, brighten it, crop it or swap colours as a grid of pixel numbers, then save it again.

NumPy popularity

86 / 100
Gid Score, #24 overall
272M
downloads a week, pypi
33.5K
GitHub stars
362
agent projects use it
NumPy: downloads per weekPyPI, numpy 270,376,221
NumPy: GitHub starsnumpy/numpy 33,459

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How NumPy is used

  • NumPy is a dependency in 362 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (22.3% of the 1,623 Python ones), #1 of 293 in ml and data science.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 3,312; those are left out of every share on this page.
  • The most used alternative in our scan is SciPy (114 projects).
  • Projects that use it most often also use pandas (52.2%), python-dotenv (45.0%), Requests (44.8%).
  • It is more common in projects set up for OpenClaw (10.8%) than for OpenCode (3.2%).

By coding agent

186 projects, 5.7%
161 projects, 5.3%
137 projects, 5.6%
36 projects, 10.8%
28 projects, 5.9%
19 projects, 4.1%
17 projects, 6.1%
11 projects, 3.2%

Often used with

In 52.2% of its projects
In 45.0% of its projects
In 44.8% of its projects
In 44.2% of its projects
In 39.5% of its projects
In 39.2% of its projects
In 35.6% of its projects
In 32.3% of its projects

NumPy in practice

Strengths

The API other array libraries target

The site says libraries for new hardware or special array types start from NumPy's API. It lists CuPy as a "NumPy-compatible array library for GPU-accelerated computing" and JAX as "Composable transformations of NumPy programs."

Vectorization and broadcasting as the shared vocabulary

You operate on whole arrays instead of writing Python loops. The site claims NumPy's way of doing this is the common standard for array code.

Math routines in the box

Linear algebra, Fourier transforms and random number generators ship with the package. You do not need a second library for these basics.

Bridges to C/C++ and Fortran

The README lists tools for integrating C/C++ and Fortran code as a core feature, next to the array object itself.

Watch out for

Recent Python only

The 2.5.4 release notes list support for Python 3.12 to 3.15. Projects pinned to older interpreters need an older NumPy.

Patch releases can change error behavior

Code that passed infinities to <code>svd</code> or <code>lstsq</code> and got a result back will now see an exception. Add a finiteness check or handle the error.

MaskedArray fill values reset on dtype change

In 2.5.4, a copied fill_value that the new dtype cannot represent falls back to the default. This can now emit a <code>ComplexWarning</code>.

More about NumPy

Funding
  • Open Collective: https://opencollective.com/numpy
  • Tidelift: https://tidelift.com/funding/github/pypi/numpy
  • Own page: https://numpy.org/about/#donate

See all

Packages around it
  • pandas: Dataframes
  • python-dotenv: .env config loading
  • requests: HTTP client
  • pydantic: Data validation
  • uvicorn: ASGI server
  • fastapi: Web API framework
More in ML and data science

Alternatives

NumPy This page

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0Gid 86272M/wk

pandas

Pick pandas when your data is a table with named columns, dates and text, such as a CSV export, rather than plain numbers.

PyTorch

Pick PyTorch when you train or run neural networks and need a graphics card; it has its own arrays called tensors.

SciPy

Pick SciPy on top of NumPy when you need ready-made scientific routines such as optimisation, signal filters or statistical tests.

BSDGid 80102M/wk

Compare NumPy with another tool

Get started

Tell your AI assistant

“Use NumPy (pin numpy==2.5.4, Python 3.12+) to load these numbers into an array, compute the median and 95th percentile, and use np.random.default_rng with a fixed seed for any random sampling.”

  1. Install NumPy into your project's Python environment (Python 3.12 to 3.14 for NumPy 2.5).

    pip install numpy

    From numpy.org/install/

  2. Check that it works by printing the installed version.

    import numpy as np
    print(np.__version__)
    

    From numpy.org/install/

  3. Make a seeded random generator and draw numbers from it, the way the docs recommend.

    import numpy as np
    rng = np.random.default_rng()
    samples = rng.normal(size=2500)
    

    From numpy.org/

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## NumPy
- Import it the standard way: `import numpy as np`.
- Create random numbers with a generator from `np.random.default_rng()`, as the homepage example does.
- Prefer vectorized, indexed and broadcast array operations to Python loops over elements.
- Check the Python version: the 2.5.4 release supports Python 3.12-3.15.
- From 2.5.4, `numpy.linalg.svd` and `numpy.linalg.lstsq` raise for inputs containing infinities. Validate inputs or catch the error, and do not rely on a returned result.
- To run NumPy's own tests after install, have `pytest` available and call `numpy.test()`.

Mistakes to avoid

np.float_, np.NaN, np.Inf and other names from NumPy 1.x tutorials
np.float64, np.nan, np.inf; run ruff check --select NPY201 to find the rest

NumPy 2.0 removed about 100 old names; in our run np.float_ raised AttributeError ("was removed in the NumPy 2.0 release. Use np.float64 instead").

np.array(data, copy=False) to avoid a copy
np.asarray(data)

In NumPy 2 copy=False means "never copy" and raises an error when a copy is needed, which it did in our run.

np.random.seed(42) then np.random.rand(...)
rng = np.random.default_rng(42), then rng.random(...), rng.choice(...)

The old global functions still work, but the docs recommend the Generator, which is faster and gets the improvements.

json.dumps({"score": scores[0]}) with a NumPy number inside
json.dumps({"score": float(scores[0])}) or scores[0].item()

NumPy numbers are not plain Python numbers; in our run json.dumps raised TypeError (Object of type float32 is not JSON serializable).

np.load(uploaded_file, allow_pickle=True)
np.load(path) with the default allow_pickle=False for files you did not make

Pickled object arrays can run code when loaded.

Questions

Can I use it in a paid, closed-source app?

Yes. The BSD-3-Clause license allows it; when you redistribute NumPy itself, keep its copyright notice and license text.

Which Python do I need?

NumPy 2.5 supports Python 3.12 to 3.14.

My old code fails with "np.float_ was removed". How do I fix it?

Replace the old names using the NumPy 2.0 migration guide (np.float_ becomes np.float64, np.NaN becomes np.nan); the Ruff rule NPY201 can fix many of them for you.

Is NumPy still maintained?

Yes. NumPy 2.5.0 came out on 2026-06-21 and the 2.5.4 package was published on PyPI on 2026-10-10.

Can I try it before installing anything?

Yes. The NumPy home page has an interactive shell that runs in the browser.

AgentGid articles about NumPy

All guides