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.txt3. Used by agents' projects
Dependency in 362 public GitHub projects set up for AI coding agents that we scanned (5.8%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
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
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
Often used with
NumPy in practice
Strengths
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."
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.
Linear algebra, Fourier transforms and random number generators ship with the package. You do not need a second library for these basics.
The README lists tools for integrating C/C++ and Fortran code as a core feature, next to the array object itself.
Watch out for
The 2.5.4 release notes list support for Python 3.12 to 3.15. Projects pinned to older interpreters need an older NumPy.
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.
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
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
Pick pandas when your data is a table with named columns, dates and text, such as a CSV export, rather than plain numbers.
Pick PyTorch when you train or run neural networks and need a graphics card; it has its own arrays called tensors.
Pick SciPy on top of NumPy when you need ready-made scientific routines such as optimisation, signal filters or statistical tests.
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.”
Install NumPy into your project's Python environment (Python 3.12 to 3.14 for NumPy 2.5).
pip install numpyFrom numpy.org/install/
Check that it works by printing the installed version.
import numpy as np print(np.__version__)From numpy.org/install/
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
## 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
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").
In NumPy 2 copy=False means "never copy" and raises an error when a copy is needed, which it did in our run.
The old global functions still work, but the docs recommend the Generator, which is faster and gets the improvements.
NumPy numbers are not plain Python numbers; in our run json.dumps raised TypeError (Object of type float32 is not JSON serializable).
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.