NumPy 2.5.0 (21 Jun 2026) is a transitional release: Python 3.12–3.14, distutils gone, array-API descending sorts on np.sort / np.argsort. Follow-ups 2.5.1 (4 Jul) and 2.5.2 (9 Aug 2026). NaNs still sort to the end. Three things to try tonight. Not investment advice.
NumPy 2.5.0 shipped 21 June 2026 (news, GitHub v2.5.0). It is a transitional release: Python 3.12–3.14, numpy.distutils removed, a pile of 2.0-era deprecations expired, free-threading work, and array-API descending sorts. Follow-ups: 2.5.1 on 4 July 2026, 2.5.2 on 9 August 2026. Prefer 2.5.2 tonight. This note is descending= plus three things to try tonight. It is not a 1.x vs 2.x migration novel, not a SIMD league table, and not investment advice.
The only course CTA is Introduction to Python Programming. Related Hub: SciPy 1.18, scikit-learn 1.9 narwhals.
From the 2.5.0 release notes (gh-31345):
descending= on numpy.sort and numpy.argsort. descending=True sorts high-to-low. NaN values still go to the end in both ascending and descending sorts. Available for built-in dtypes except void, object, and generic. SIMD sort kernels are not used for descending yet — may be slower. This is the array-API alignment piece.
Transitional breakage you might hit before you sort. Python 3.11 dropped. numpy.distutils gone. numpy.row_stack gone (vstack). numpy.cross no longer 2-D vectors. linalg.eig / eigvals always return complex. Generator.binomial streams may change (BTPE Stirling fix); RandomState.binomial does not. datetime64 / timedelta64 arithmetic OverflowError instead of wrap-to-NaT.
Free-threading. Lock-free ufunc dispatch and PyMem_RawMalloc as the default allocator — ufuncs scale better on free-threaded CPython. Relevant if you already run 3.13t/3.14t; not a reason to switch the interpreter tonight.
New deprecations (read, do not panic): mutating .dtype / .shape / in-place resize; numpy.fix → trunc; chararray; generic timedelta64 unit.
Also: searchsorted faster for many keys; reductions fast path; match/case on ndarrays; polyvalnd family. Not tonight.
python -c "import numpy as np; print(np.__version__)"
# pip install -U "numpy==2.5.2"
1. Descending sort vs the old [::-1] trick (NaNs):
import numpy as np
x = np.array([1.0, np.nan, 3.0, 2.0])
print("asc ", np.sort(x))
print("desc", np.sort(x, descending=True))
print("flip", np.sort(x)[::-1]) # NaN placement differs from descending=
print("idx ", np.argsort(x, descending=True), x[np.argsort(x, descending=True)])
2. Integers / 2-D along an axis:
import numpy as np
a = np.array([[1, 8, 3], [9, 2, 5]])
print(np.sort(a, axis=1, descending=True))
3. Confirm 3.11 is out if a CI still pins it: 2.5.x wants 3.12–3.14. Pin 2.5.2, not 2.5.0.
Stop after one of three. Notes: 2.5.0-notes.
x[::-1] in the org tonight”.If Python environments still fight you, Introduction to Python Programming, then print numpy.__version__ and run the NaN descending sketch.