NumPy 2.6.0 Release Notes#

Highlights#

We’ll choose highlights for this release near the end of the release cycle.

Expired deprecations#

  • The deprecated 'full', 'f', 'economic', and 'e' modes of numpy.linalg.qr have been removed. These were deprecated in NumPy 1.8. Use 'reduced' instead of 'full'/'f', and 'raw' instead of 'economic'/'e'.

    (gh-31387)

New Features#

New descending keyword argument for numpy.partition and numpy.argpartition#

Users can now pass the descending=True keyword argument to numpy.partition and numpy.argpartition to partition and argpartition arrays in descending order. NaN values, if present, are partitioned to the end of the array in both ascending and descending sorts. This feature is available for all built-in dtypes except string, unicode, void, object, and generic. Note that SIMD optimizations for partitioning are currently not available for descending order, so performance may be slower.

(gh-31511)

Improvements#

Object array sorting supports descending=True and consistently sorts NaN-like objects#

np.sort and np.argsort with arrays of dtype object now support passing descending=True to sort in descending order. Objects that compare as not equal to themselves (obj != obj), such as NaN-like objects, are considered unordered and are sorted to the end of the array, regardless of the value of descending.

(gh-31431)

Changes#

NumPy’s internal memory allocations now use PyMem_RawMalloc#

NumPy’s internal memory allocations now use PyMem_RawMalloc instead of malloc and can be tracked by tracemalloc.

(gh-31503)