chore(deps): update dependency numpy to >=2.4.6,<3.0.0 #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/numpy-2.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
>=1.26.0,<2.3.0→>=2.4.6,<3.0.0Release Notes
numpy/numpy (numpy)
v2.4.6: (May 18, 2026)Compare Source
NumPy 2.4.6 Release Notes
NumPy 2.4.6 is a quick release that fixes a regression discovered in the 2.4.5
release.
This release supports Python versions 3.11-3.14
Contributors
A total of 4 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 4 pull requests were merged for this release.
arr.conj()np.linalg.svd(..., hermitian=True)returns non-unitary...v2.4.5: (May 15, 2026)Compare Source
NumPy 2.4.5 Release Notes
NumPy 2.4.5 is a patch release that fixes bugs discovered after the 2.4.4
release, has some typing improvements, and maintains infrastructure.
This release supports Python versions 3.11-3.14
Contributors
A total of 17 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 28 pull requests were merged for this release.
np.shapeassignability issue for python lists (#31171)pack_inner...tile: accept numpy scalars and arrays as second argument...ix_fix for boolean and non-1d input (#31218)_NestedSequencetype parameter default to work around...DTypeLikeruntime type-checker support (#31425)v2.4.4: 2.4.4 (Mar 29, 2026)Compare Source
NumPy 2.4.4 Release Notes
The NumPy 2.4.4 is a patch release that fixes bugs discovered after the 2.4.3
release. It should finally close issue #30816, the OpenBLAS threading problem
on ARM.
This release supports Python versions 3.11-3.14
Contributors
A total of 8 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 7 pull requests were merged for this release.
sprintfwithsnprintf...v2.4.3: 2.4.3 (Mar 9, 2026)Compare Source
NumPy 2.4.3 Release Notes
The NumPy 2.4.3 is a patch release that fixes bugs discovered after the
2.4.2 release. The most user visible fix may be a threading fix for
OpenBLAS on ARM, closing issue #30816.
This release supports Python versions 3.11-3.14
Contributors
A total of 11 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 14 pull requests were merged for this release.
matlib: missing extended precision importsv2.4.2: 2.4.2 (Feb 1, 2026)Compare Source
NumPy 2.4.2 Release Notes
The NumPy 2.4.2 is a patch release that fixes bugs discovered after the
2.4.1 release. Highlights are:
This release supports Python versions 3.11-3.14
Contributors
A total of 9 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 12 pull requests were merged for this release.
arange: accept datetime stringsos.environ...array_getbuffer(#30667)v2.4.1: 2.4.1 (Jan 10, 2026)Compare Source
NumPy 2.4.1 Release Notes
The NumPy 2.4.1 is a patch release that fixes bugs discoved after the
2.4.0 release. In particular, the typo
SeedlessSequenceis preserved toenable wheels using the random Cython API and built against NumPy < 2.4.0
to run without errors.
This release supports Python versions 3.11-3.14
Contributors
A total of 9 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 15 pull requests were merged for this release.
numpy.select: fixdefaultparameter docstring...numpy.select: allow passing array-likedefault...v2.4.0: 2.4.0 (Dec 20, 2025)Compare Source
NumPy 2.4.0 Release Notes
The NumPy 2.4.0 release continues the work to improve free threaded Python
support, user dtypes implementation, and annotations. There are many expired
deprecations and bug fixes as well.
This release supports Python versions 3.11-3.14
Highlights
Apart from annotations and
same_valuekwarg, the 2.4 highlights are mostlyof interest to downstream developers. They should help in implementing new user
dtypes.
castingkwarg'same_value'for casting by value.PyUFunc_AddLoopsFromSpecfunction that can be used to add user sortloops using the
ArrayMethodAPI.__numpy_dtype__protocol.Deprecations
Setting the
stridesattribute is deprecatedSetting the strides attribute is now deprecated since mutating
an array is unsafe if an array is shared, especially by multiple
threads. As an alternative, you can create a new view (no copy) via:
np.lib.stride_tricks.strided_window_viewif applicable,np.lib.stride_tricks.as_stridedfor the general case,np.ndarrayconstructor (bufferis the original array) for alight-weight version.
(gh-28925)
Positional
outargument tonp.maximum,np.minimumis deprecatedPassing the output array
outpositionally tonumpy.maximumandnumpy.minimumis deprecated. For example,np.maximum(a, b, c)will emita deprecation warning, since
cis treated as the output buffer rather thana third input.
Always pass the output with the keyword form, e.g.
np.maximum(a, b, out=c).This makes intent clear and simplifies type annotations.
(gh-29052)
align=must be passed as boolean tonp.dtype()When creating a new
dtypeaVisibleDeprecationWarningwill be given ifalign=is not a boolean. This is mainly to prevent accidentally passing asubarray align flag where it has no effect, such as
np.dtype("f8", 3)instead of
np.dtype(("f8", 3)). We strongly suggest to always passalign=as a keyword argument.(gh-29301)
Assertion and warning control utilities are deprecated
np.testing.assert_warnsandnp.testing.suppress_warningsaredeprecated. Use
warnings.catch_warnings,warnings.filterwarnings,pytest.warns, orpytest.filterwarningsinstead.(gh-29550)
np.fixis pending deprecationThe
numpy.fixfunction will be deprecated in a future release. It isrecommended to use
numpy.truncinstead, as it provides the samefunctionality of truncating decimal values to their integer parts. Static type
checkers might already report a warning for the use of
numpy.fix.(gh-30168)
in-place modification of
ndarray.shapeis pending deprecationSetting the
ndarray.shapeattribute directly will be deprecated in a futurerelease. Instead of modifying the shape in place, it is recommended to use the
numpy.reshapefunction. Static type checkers might already report awarning for assignments to
ndarray.shape.(gh-30282)
Deprecation of
numpy.lib.user_array.containerThe
numpy.lib.user_array.containerclass is deprecated and will be removedin a future version.
(gh-30284)
Expired deprecations
Removed deprecated
MachArruntime discovery mechanism.(gh-29836)
Raise
TypeErroron attempt to convert array withndim > 0to scalarConversion of an array with
ndim > 0to a scalar was deprecated in NumPy1.25. Now, attempting to do so raises
TypeError. Ensure you extract asingle element from your array before performing this operation.
(gh-29841)
Removed numpy.linalg.linalg and numpy.fft.helper
The following were deprecated in NumPy 2.0 and have been moved to private
modules:
numpy.linalg.linalgUse
numpy.linalginstead.numpy.fft.helperUse
numpy.fftinstead.(gh-29909)
Removed
interpolationparameter from quantile and percentile functionsThe
interpolationparameter was deprecated in NumPy 1.22.0 and has beenremoved from the following functions:
numpy.percentilenumpy.nanpercentilenumpy.quantilenumpy.nanquantileUse the
methodparameter instead.(gh-29973)
Removed
numpy.in1dnumpy.in1dhas been deprecated since NumPy 2.0 and is now removed in favor ofnumpy.isin.(gh-29978)
Removed
numpy.ndindex.ndincr()The
ndindex.ndincr()method has been deprecated since NumPy 1.20 and is nowremoved; use
next(ndindex)instead.(gh-29980)
Removed
fix_importsparameter fromnumpy.saveThe
fix_importsparameter was deprecated in NumPy 2.1.0 and is now removed.This flag has been ignored since NumPy 1.17 and was only needed to support
loading files in Python 2 that were written in Python 3.
(gh-29984)
Removal of four undocumented
ndarray.ctypesmethodsFour undocumented methods of the
ndarray.ctypesobject have been removed:_ctypes.get_data()(use_ctypes.datainstead)_ctypes.get_shape()(use_ctypes.shapeinstead)_ctypes.get_strides()(use_ctypes.stridesinstead)_ctypes.get_as_parameter()(use_ctypes._as_parameter_instead)These methods have been deprecated since NumPy 1.21.
(gh-29986)
Removed
newshapeparameter fromnumpy.reshapeThe
newshapeparameter was deprecated in NumPy 2.1.0 and has beenremoved from
numpy.reshape. Pass it positionally or useshape=on newer NumPy versions.
(gh-29994)
Removal of deprecated functions and arguments
The following long-deprecated APIs have been removed:
numpy.trapz--- deprecated since NumPy 2.0 (2023-08-18). Usenumpy.trapezoidorscipy.integratefunctions instead.dispfunction --- deprecated from 2.0 release and no longer functional. Useyour own printing function instead.
biasandddofarguments innumpy.corrcoef--- these had no effectsince NumPy 1.10.
(gh-29997)
Removed
delimitorparameter fromnumpy.ma.mrecords.fromtextfile()The
delimitorparameter was deprecated in NumPy 1.22.0 and has beenremoved from
numpy.ma.mrecords.fromtextfile(). Usedelimiterinstead.(gh-30021)
numpy.array2stringandnumpy.sumdeprecations finalizedThe following long-deprecated APIs have been removed or converted to errors:
styleparameter has been removed fromnumpy.array2string.This argument had no effect since Numpy 1.14.0. Any arguments following
it, such as
formatterhave now been made keyword-only.np.sum(generator)directly on a generator object now raises aTypeError. This behavior was deprecated in NumPy 1.15.0. Usenp.sum(np.fromiter(generator))or the pythonsumbuiltin instead.(gh-30068)
Compatibility notes
NumPy's C extension modules have begun to use multi-phase initialisation, as
defined by PEP 489. As part of this, a new explicit check has been added that
each such module is only imported once per Python process. This comes with
the side-effect that deleting
numpyfromsys.modulesand re-importingit will now fail with an
ImportError. This has always been unsafe, withunexpected side-effects, though did not previously raise an error.
(gh-29030)
numpy.roundnow always returns a copy. Previously, it returned a viewfor integer inputs for
decimals >= 0and a copy in all other cases.This change brings
roundin line withceil,floorandtrunc.(gh-29137)
Type-checkers will no longer accept calls to
numpy.arangewithstartas a keyword argument. This was done for compatibility withthe Array API standard. At runtime it is still possible to use
numpy.arangewithstartas a keyword argument.(gh-30147)
The Macro NPY_ALIGNMENT_REQUIRED has been removed The macro was defined in
the
npy_cpu.hfile, so might be regarded as semi public. As it turns out,with modern compilers and hardware it is almost always the case that
alignment is required, so numpy no longer uses the macro. It is unlikely
anyone uses it, but you might want to compile with the
-Wundefflag orequivalent to be sure.
(gh-29094)
C API changes
The NPY_SORTKIND enum has been enhanced with new variables
This is of interest if you are using
PyArray_SortorPyArray_ArgSort.We have changed the semantics of the old names in the
NPY_SORTKINDenum andadded new ones. The changes are backward compatible, and no recompilation is
needed. The new names of interest are:
NPY_SORT_DEFAULT-- default sort (same value asNPY_QUICKSORT)NPY_SORT_STABLE-- the sort must be stable (same value asNPY_MERGESORT)NPY_SORT_DESCENDING-- the sort must be descendingThe semantic change is that
NPY_HEAPSORTis mapped toNPY_QUICKSORTwhen used.Note that
NPY_SORT_DESCENDINGis not yet implemented.(gh-29642)
New
NPY_DT_get_constantslot for DType constant retrievalA new slot
NPY_DT_get_constanthas been added to the DType API, allowingdtype implementations to provide constant values such as machine limits and
special values. The slot function has the signature:
It returns 1 on success, 0 if the constant is not available, or -1 on error.
The function is always called with the GIL held and may write to unaligned memory.
Integer constants (marked with the
1 << 16bit) returnnpy_intpvalues,while floating-point constants return values of the dtype's native type.
Implementing this can be used by user DTypes to provide
numpy.finfovalues.(gh-29836)
A new
PyUFunc_AddLoopsFromSpecsconvenience function has been added to the C API.This function allows adding multiple ufunc loops from their specs in one call
using a NULL-terminated array of
PyUFunc_LoopSlotstructs. It allowsregistering sorting and argsorting loops using the new ArrayMethod API.
(gh-29900)
New Features
Let
np.sizeaccept multiple axes.(gh-29240)
Extend
numpy.padto accept a dictionary for thepad_widthargument.(gh-29273)
'same_value'for casting by valueThe
castingkwarg now has a'same_value'option that checks the actualvalues can be round-trip cast without changing value. Currently it is only
implemented in
ndarray.astype. This will raise aValueErrorif any of thevalues in the array would change as a result of the cast, including rounding of
floats or overflowing of ints.
(gh-29129)
StringDTypefill_value support innumpy.ma.MaskedArrayMasked arrays now accept and preserve a Python
stras theirfill_valuewhen using the variable‑width
StringDType(kind'T'), including throughslicing and views. The default is
'N/A'and may be overridden by any validstring. This fixes issue gh‑29421
and was implemented in pull request gh‑29423.
(gh-29423)
ndmaxoption fornumpy.arrayThe
ndmaxoption is now available fornumpy.array.It explicitly limits the maximum number of dimensions created from nested sequences.
This is particularly useful when creating arrays of list-like objects with
dtype=object.By default, NumPy recurses through all nesting levels to create the highest possible
dimensional array, but this behavior may not be desired when the intent is to preserve
nested structures as objects. The
ndmaxparameter provides explicit control overthis recursion depth.
(gh-29569)
Warning emitted when using
wherewithoutoutUfuncs called with a
wheremask and without anoutpositional or kwarg willnow emit a warning. This usage tends to trip up users who expect some value in
output locations where the mask is
False(the ufunc will not touch thoselocations). The warning can be suppressed by using
out=None.(gh-29813)
DType sorting and argsorting supports the ArrayMethod API
User-defined dtypes can now implement custom sorting and argsorting using the
ArrayMethodAPI. This mechanism can be used in place of thePyArray_ArrFuncsslots which may be deprecated in the future.The sorting and argsorting methods are registered by passing the arraymethod
specs that implement the operations to the new
PyUFunc_AddLoopsFromSpecsfunction. See the
ArrayMethodAPI documentation for details.(gh-29900)
New
__numpy_dtype__protocolNumPy now has a new
__numpy_dtype__protocol. NumPy will checkfor this attribute when converting to a NumPy dtype via
np.dtype(obj)or any
dtype=argument.Downstream projects are encouraged to implement this for all dtype like
objects which may previously have used a
.dtypeattribute that returneda NumPy dtype.
We expect to deprecate
.dtypein the future to prevent interpretingarray-like objects with a
.dtypeattribute as a dtype.If you wish you can implement
__numpy_dtype__to ensure an earlierwarning or error (
.dtypeis ignored if this is found).(gh-30179)
Improvements
Fix
flatiterindexing edge casesThe
flatiterobject now shares the same index preparation logic asndarray, ensuring consistent behavior and fixing several issues whereinvalid indices were previously accepted or misinterpreted.
Key fixes and improvements:
Stricter index validation
arr.flat[[True, True]]wereincorrectly treated as
arr.flat[np.array([1, 1], dtype=int)].They now raise an index error. Note that indices that match the
iterator's shape are expected to not raise in the future and be
handled as regular boolean indices. Use
np.asarray(<index>)ifyou want to match that behavior.
treated as
arr.flat[np.array([1.0, 1.0], dtype=int)]. This is nowdeprecated and will be removed in a future version.
arr.flat[True]are alsodeprecated and will be removed in a future version.
Consistent error types:
Certain invalid
flatiterindices that previously raisedValueErrornow correctly raise
IndexError, aligning withndarraybehavior.Improved error messages:
The error message for unsupported index operations now provides more
specific details, including explicitly listing the valid index types,
instead of the generic
IndexError: unsupported index operation.(gh-28590)
Improved error handling in
np.quantile[np.quantile]{.title-ref} now raises errors if:
np.nannp.inf(gh-28595)
Improved error message for
assert_array_compareThe error message generated by
assert_array_comparewhich is used by functionslike
assert_allclose,assert_array_lessetc. now also includes informationabout the indices at which the assertion fails.
(gh-29112)
Show unit information in
__repr__fordatetime64("NaT")When a
datetime64object is "Not a Time" (NaT), its__repr__method nowincludes the time unit of the datetime64 type. This makes it consistent with
the behavior of a
timedelta64object.(gh-29396)
Performance increase for scalar calculations
The speed of calculations on scalars has been improved by about a factor 6 for
ufuncs that take only one input (like
np.sin(scalar)), reducing the speeddifference from their
mathequivalents from a factor 19 to 3 (the speedfor arrays is left unchanged).
(gh-29819)
numpy.finfoRefactorThe
numpy.finfoclass has been completely refactored to obtain floating-pointconstants directly from C compiler macros rather than deriving them at runtime.
This provides better accuracy, platform compatibility and corrected
several attribute calculations:
eps,min,max,smallest_normal, andsmallest_subnormalnow come directly from standard C macros (FLT_EPSILON,DBL_MIN, etc.), ensuring platform-correct values.MachArruntime discovery mechanism has been removed.machepandnegepnow useint(log2(eps));nexpaccounts forall exponent patterns;
nmantexcludes the implicit bit; andminexpfollows the C standard definition.
smallest_normalnow follows theC standard definitions as per respecitive platform.
test_finfo.pyto validate allfinfoproperties against expected machine arithmetic values forfloat16, float32, and float64 types.
(gh-29836)
Multiple axes are now supported in
numpy.trim_zerosThe
axisargument ofnumpy.trim_zerosnow accepts a sequence; for examplenp.trim_zeros(x, axis=(0, 1))will trim the zeros from a multi-dimensionalarray
xalong axes 0 and 1. This fixes issuegh‑29945 and was implemented
in pull request gh‑29947.
(gh-29947)
Runtime signature introspection support has been significantly improved
Many NumPy functions, classes, and methods that previously raised
ValueErrorwhen passed toinspect.signature()now return meaningfulsignatures. This improves support for runtime type checking, IDE autocomplete,
documentation generation, and runtime introspection capabilities across the
NumPy API.
Over three hundred classes and functions have been updated in total, including,
but not limited to, core classes such as
ndarray,generic,dtype,ufunc,broadcast,nditer, etc., most methods ofndarrayandscalar types, array constructor functions (
array,empty,arange,fromiter, etc.), allufuncs, and many other commonly used functions,including
dot,concat,where,bincount,can_cast, andnumerous others.
(gh-30208)
Performance improvements and changes
Performance improvements to
np.uniquefor string dtypesThe hash-based algorithm for unique extraction provides an order-of-magnitude
speedup on large string arrays. In an internal benchmark with about 1 billion
string elements, the hash-based np.unique completed in roughly 33.5 seconds,
compared to 498 seconds with the sort-based method -- about 15× faster for
unsorted unique operations on strings. This improvement greatly reduces the
time to find unique values in very large string datasets.
(gh-28767)
Rewrite of
np.ndindexusingitertools.productThe
numpy.ndindexfunction now usesitertools.productinternally,providing significant improvements in performance for large iteration spaces,
while maintaining the original behavior and interface. For example, for an
array of shape (50, 60, 90) the NumPy
ndindexbenchmark improvesperformance by a factor 5.2.
(gh-29165)
Performance improvements to
np.uniquefor complex dtypesThe hash-based algorithm for unique extraction now also supports
complex dtypes, offering noticeable performance gains.
In our benchmarks on complex128 arrays with 200,000 elements,
the hash-based approach was about 1.4--1.5× faster
than the sort-based baseline when there were 20% of unique values,
and about 5× faster when there were 0.2% of unique values.
(gh-29537)
Changes
Multiplication between a string and integer now raises OverflowError instead
of MemoryError if the result of the multiplication would create a string that
is too large to be represented. This follows Python's behavior.
(gh-29060)
The accuracy of
np.quantileandnp.percentilefor 16- and 32-bitfloating point input data has been improved.
(gh-29105)
unique_valuesfor string dtypes may return unsorted datanp.unique now supports hash‐based duplicate removal for string dtypes.
This enhancement extends the hash-table algorithm to byte strings ('S'),
Unicode strings ('U'), and the experimental string dtype ('T', StringDType).
As a result, calling np.unique() on an array of strings will use
the faster hash-based method to obtain unique values.
Note that this hash-based method does not guarantee that the returned unique values will be sorted.
This also works for StringDType arrays containing None (missing values)
when using equal_nan=True (treating missing values as equal).
(gh-28767)
Modulate dispatched x86 CPU features
IMPORTANT: The default setting for
cpu-baselineon x86 has been raisedto
x86-64-v2microarchitecture. This can be changed to none during buildtime to support older CPUs, though SIMD optimizations for pre-2009 processors
are no longer maintained.
NumPy has reorganized x86 CPU features into microarchitecture-based groups
instead of individual features, aligning with Linux distribution standards and
Google Highway requirements.
Key changes:
X86_V2,X86_V3, andX86_V4X86_V2-operator behavior to properly exclude successor features thatimply the excluded feature
compatibility
AVX512 without mask operations)
support
New Feature Group Hierarchy:
Name Implies Includes
X86_V2SSESSE2SSE3SSSE3SSE4_1SSE4_2POPCNTCX16LAHFX86_V3X86_V2AVXAVX2FMA3BMIBMI2LZCNTF16CMOVBEX86_V4X86_V3AVX512FAVX512CDAVX512VLAVX512BWAVX512DQAVX512_ICLX86_V4AVX512VBMIAVX512VBMI2AVX512VNNIAVX512BITALGAVX512VPOPCNTDQAVX512IFMAVAESGFNIVPCLMULQDQAVX512_SPRAVX512_ICLAVX512FP16These groups correspond to CPU generations:
X86_V2: x86-64-v2 microarchitectures (CPUs since 2009)X86_V3: x86-64-v3 microarchitectures (CPUs since 2015)X86_V4: x86-64-v4 microarchitectures (AVX-512 capable CPUs)AVX512_ICL: Intel Ice Lake and similar CPUsAVX512_SPR: Intel Sapphire Rapids and newer CPUsOn 32-bit x86,
cx16is excluded fromX86_V2.Documentation has been updated with details on using these new feature groups
with the current meson build system.
(gh-28896)
Fix bug in
matmulfor non-contiguous out kwarg parameterIn some cases, if
outwas non-contiguous,np.matmulwould cause memorycorruption or a c-level assert. This was new to v2.3.0 and fixed in v2.3.1.
(gh-29179)
__array_interface__with NULL pointer changedThe array interface now accepts NULL pointers (NumPy will do its own dummy
allocation, though). Previously, these incorrectly triggered an undocumented
scalar path. In the unlikely event that the scalar path was actually desired,
you can (for now) achieve the previous behavior via the correct scalar path by
not providing a
datafield at all.(gh-29338)
unique_valuesfor complex dtypes may return unsorted datanp.unique now supports hash‐based duplicate removal for complex dtypes. This
enhancement extends the hash‐table algorithm to all complex types ('c'), and
their extended precision variants. The hash‐based method provides faster
extraction of unique values but does not guarantee that the result will be
sorted.
(gh-29537)
Sorting
kind='heapsort'now maps tokind='quicksort'It is unlikely that this change will be noticed, but if you do see a change in
execution time or unstable argsort order, that is likely the cause. Please let
us know if there is a performance regression. Congratulate us if it is improved
:)
(gh-29642)
numpy.typing.DTypeLikeno longer acceptsNoneThe type alias
numpy.typing.DTypeLikeno longer acceptsNone. Instead ofit should now be
instead.
(gh-29739)
The
npymathandnpyrandomlibraries now have a.librather than a.afile extension on win-arm64, for compatibility for building with MSVCand
setuptools. Please note that using these static libraries isdiscouraged and for existing projects using it, it's best to use it with a
matching compiler toolchain, which is
clang-clon Windows on Arm.(gh-29750)
v2.3.5: 2.3.5 (Nov 16, 2025)Compare Source
NumPy 2.3.5 Release Notes
The NumPy 2.3.5 release is a patch release split between a number of maintenance
updates and bug fixes. This release supports Python versions 3.11-3.14.
Contributors
A total of 10 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 16 pull requests were merged for this release.
orderparameter docs ofma.asanyarray...v2.3.4: (Oct 15, 2025)Compare Source
NumPy 2.3.4 Release Notes
The NumPy 2.3.4 release is a patch release split between a number of maintenance
updates and bug fixes. This release supports Python versions 3.11-3.14. This
release is based on Python 3.14.0 final.
Changes
The
npymathandnpyrandomlibraries now have a.librather than a.afile extension on win-arm64, for compatibility for building with MSVC andsetuptools. Please note that using these static libraries is discouragedand for existing projects using it, it's best to use it with a matching
compiler toolchain, which is
clang-clon Windows on Arm.(gh-29750)
Contributors
A total of 17 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 30 pull requests were merged for this release.
dtyperefcount in__array__(#29715)__slots__(#29901)testing._private(#29902)errstate(#29914)@classmethodarg to clsv2.3.3: 2.3.3 (Sep 9, 2025)Compare Source
NumPy 2.3.3 Release Notes
The NumPy 2.3.3 release is a patch release split between a number of maintenance
updates and bug fixes. This release supports Python versions 3.11-3.14. Note
that the 3.14.0 final is currently expected in Oct, 2025. This release is based
on 3.14.0rc2.
Contributors
A total of 13 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
Pull requests merged
A total of 23 pull requests were merged for this release.
sortedkwarg touniquev2.3.2: (Jul 24, 2025)Compare Source
NumPy 2.3.2 Release Notes
The NumPy 2.3.2 release is a patch release with a number of bug fixes
and maintenance updates. The highlights are:
This release supports Python versions 3.11-3.14
Contributors
A total of 9 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Pull requests merged
A total of 16 pull requests were merged for this release.
np.char.arrayandnp.char.asarray...squareonarr \*\* 2(#29392)Checksums
MD5
SHA256
v2.3.1: (Jun 21, 2025)Compare Source
NumPy 2.3.1 Release Notes
The NumPy 2.3.1 release is a patch release with several bug fixes,
annotation improvements, and better support for OpenBSD. Highlights are:
matmulfor non-contiguous out kwarg parameternp.vectorizecasting errorsThis release supports Python versions 3.11-3.13, Python 3.14 will be
supported when it is released.
Contributors
A total of 9 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.
Pull requests merged
A total of 12 pull requests were merged for this release.
np.vectorizecasting to legacy behavior (#29196)Checksums
MD5
SHA256
v2.3.0: (June 7, 2025)Compare Source
NumPy 2.3.0 Release Notes
The NumPy 2.3.0 release continues the work to improve free threaded
Python support and annotations together with the usual set of bug fixes.
It is unusual in the number of expired deprecations, code
modernizations, and style cleanups. The latter may not be visible to
users, but is important for code maintenance over the long term. Note
that we have also upgraded from manylinux2014 to manylinux_2_28.
Users running on a Mac having an M4 cpu might see various warnings about
invalid values and such. The warnings are a known problem with
Accelerate. They are annoying, but otherwise harmless. Apple promises to
fix them.
This release supports Python versions 3.11-3.13, Python 3.14 will be
supported when it is released.
Highlights
New functions
New function
numpy.strings.sliceThe new function
numpy.strings.slicewas added, which implements fastnative slicing of string arrays. It supports the full slicing API
including negative slice offsets and steps.
(gh-27789)
Deprecations
The
numpy.typing.mypy_pluginhas been deprecated in favor ofplatform-agnostic static type inference. Please remove
numpy.typing.mypy_pluginfrom thepluginssection of your mypyconfiguration. If this change results in new errors being reported,
kindly open an issue.
(gh-28129)
The
numpy.typing.NBitBasetype has been deprecated and will beremoved in a future version.
This type was previously intended to be used as a generic upper
bound for type-parameters, for example:
But in NumPy 2.2.0,
float64andcomplex128were changed toconcrete subtypes, causing static type-checkers to reject
x: np.float64 = f(np.complex128(42j)).So instead, the better approach is to use
typing.overload:(gh-28884)
Expired deprecations
Remove deprecated macros like
NPY_OWNDATAfrom Cython interfacesin favor of
NPY_ARRAY_OWNDATA(deprecated since 1.7)(gh-28254)
Remove
numpy/npy_1_7_deprecated_api.hand C macros likeNPY_OWNDATAin favor ofNPY_ARRAY_OWNDATA(deprecated since 1.7)(gh-28254)
Remove alias
generate_divbyzero_errortonpy_set_floatstatus_divbyzeroandgenerate_overflow_errortonpy_set_floatstatus_overflow(deprecated since 1.10)(gh-28254)
Remove
np.tostring(deprecated since 1.19)(gh-28254)
Raise on
np.conjugateof non-numeric types (deprecated since 1.13)(gh-28254)
Raise when using
np.bincount(...minlength=None), use 0 instead(deprecated since 1.14)
(gh-28254)
Passing
shape=Noneto functions with a non-optional shape argumenterrors, use
()instead (deprecated since 1.20)(gh-28254)
Inexact matches for
modeandsearchsideraise (deprecated since1.20)
(gh-28254)
Setting
__array_finalize__ = Noneerrors (deprecated since 1.23)(gh-28254)
np.fromfileandnp.fromstringerror on bad data, previously theywould guess (deprecated since 1.18)
(gh-28254)
datetime64andtimedelta64construction with a tuple no longeraccepts an
eventvalue, either use a two-tuple of (unit, num) or a4-tuple of (unit, num, den, 1) (deprecated since 1.14)
(gh-28254)
When constructing a
dtypefrom a class with adtypeattribute,that attribute must be a dtype-instance rather than a thing that can
be parsed as a dtype instance (deprecated in 1.19). At some point
the whole construct of using a dtype attribute will be deprecated
(see #25306)
(gh-28254)
Passing booleans as partition index errors (deprecated since 1.23)
(gh-28254)
Out-of-bounds indexes error even on empty arrays (deprecated since
1.20)
(gh-28254)
np.tostringhas been removed, usetobytesinstead (deprecatedsince 1.19)
(gh-28254)
Disallow make a non-writeable array writeable for arrays with a base
that do not own their data (deprecated since 1.17)
(gh-28254)
concatenate()withaxis=Noneusessame-kindcasting bydefault, not
unsafe(deprecated since 1.20)(gh-28254)
Unpickling a scalar with object dtype errors (deprecated since 1.20)
(gh-28254)
The binary mode of
fromstringnow errors, usefrombufferinstead(deprecated since 1.14)
(gh-28254)
Converting
np.inexactornp.floatingto a dtype errors(deprecated since 1.19)
(gh-28254)
Converting
np.complex,np.integer,np.signedinteger,np.unsignedinteger,np.genericto a dtype errors (deprecatedsince 1.19)
(gh-28254)
The Python built-in
rounderrors for complex scalars. Usenp.roundorscalar.roundinstead (deprecated since 1.19)(gh-28254)
'np.bool' scalars can no longer be interpreted as an index
(deprecated since 1.19)
(gh-28254)
Parsing an integer via a float string is no longer supported.
(deprecated since 1.23) To avoid this error you can
converters=floatkeyword argument.np.loadtxt(...).astype(np.int64)(gh-28254)
The use of a length 1 tuple for the ufunc
signatureerrors. Usedtypeor fill the tuple withNone(deprecated since 1.19)(gh-28254)
Special handling of matrix is in np.outer is removed. Convert to a
ndarray via
matrix.A(deprecated since 1.20)(gh-28254)
Removed the
np.compatpackage source code (removed in 2.0)(gh-28961)
C API changes
NpyIter_GetTransferFlagsis now available to check if the iteratorneeds the Python API or if casts may cause floating point errors
(FPE). FPEs can for example be set when casting
float64(1e300)tofloat32(overflow to infinity) or a NaN to an integer (invalidvalue).
(gh-27883)
NpyIternow has no limit on the number of operands it supports.(gh-28080)
New
NpyIter_GetTransferFlagsandNpyIter_IterationNeedsAPIchangeNumPy now has the new
NpyIter_GetTransferFlagsfunction as a moreprecise way checking of iterator/buffering needs. I.e. whether the
Python API/GIL is required or floating point errors may occur. This
function is also faster if you already know your needs without
buffering.
The
NpyIter_IterationNeedsAPIfunction now performs all the checksthat were previously performed at setup time. While it was never
necessary to call it multiple times, doing so will now have a larger
cost.
(gh-27998)
New Features
The type parameter of
np.dtypenow defaults totyping.Any. Thisway, static type-checkers will infer
dtype: np.dtypeasdtype: np.dtype[Any], without reporting an error.(gh-28669)
Static type-checkers now interpret:
_: np.ndarrayas_: npt.NDArray[typing.Any]._: np.flatiteras_: np.flatiter[np.ndarray].This is because their type parameters now have default values.
(gh-28940)
NumPy now registers its pkg-config paths with the pkgconf PyPI package
The pkgconf PyPI
package provides an interface for projects like NumPy to register their
own paths to be added to the pkg-config search path. This means that
when using pkgconf
from PyPI, NumPy will be discoverable without needing for any custom
environment configuration.
(gh-28214)
Allow
out=...in ufuncs to ensure array resultNumPy has the sometimes difficult behavior that it currently usually
returns scalars rather than 0-D arrays (even if the inputs were 0-D
arrays). This is especially problematic for non-numerical dtypes (e.g.
object).For ufuncs (i.e. most simple math functions) it is now possible to use
out=...(literally `...`, e.g.out=Ellipsis) which is identicalin behavior to
outnot being passed, but will ensure a non-scalarreturn. This spelling is borrowed from
arr1d[0, ...]where the...also ensures a non-scalar return.
Other functions with an
out=kwarg should gain support eventually.Downstream libraries that interoperate via
__array_ufunc__or__array_function__may need to adapt to support this.(gh-28576)
Building NumPy with OpenMP Parallelization
NumPy now supports OpenMP parallel processing capabilities when built
with the
-Denable_openmp=trueMeson build flag. This feature isdisabled by default. When enabled,
np.sortandnp.argsortfunctionscan utilize OpenMP for parallel thread execution, improving performance
for these operations.
(gh-28619)
Interactive examples in the NumPy documentation
The NumPy documentation includes a number of examples that can now be
run interactively in your browser using WebAssembly and Pyodide.
Please note that the examples are currently experimental in nature and
may not work as expected for all methods in the public API.
(gh-26745)
Improvements
Scalar comparisons between non-comparable dtypes such as
np.array(1) == np.array('s')now return a NumPy bool instead of aPython bool.
(gh-27288)
np.nditernow has no limit on the number of supported operands(C-integer).
(gh-28080)
No-copy pickling is now supported for any array that can be
transposed to a C-contiguous array.
(gh-28105)
The
__repr__for user-defined dtypes now prefers the__name__ofthe custom dtype over a more generic name constructed from its
kindanditemsize.(gh-28250)
np.dotnow reports floating point exceptions.(gh-28442)
np.dtypes.StringDTypeis now a generictype which
accepts a type argument for
na_objectthat defaults totyping.Never. For example,StringDType(na_object=None)returns aStringDType[None], andStringDType()returns aStringDType[typing.Never].(gh-28856)
Added warnings to
np.iscloseAdded warning messages if at least one of atol or rtol are either
np.nanornp.infwithinnp.isclose.np.seterrsettings(gh-28205)
Performance improvements and changes
Performance improvements to
np.uniquenp.uniquenow tries to use a hash table to find unique values insteadof sorting values before finding unique values. This is limited to
certain dtypes for now, and the function is now faster for those dtypes.
The function now also exposes a
sortedparameter to allow returningunique values as they were found, instead of sorting them afterwards.
(gh-26018)
Performance improvements to
np.sortandnp.argsortnp.sortandnp.argsortfunctions now can leverage OpenMP forparallel thread execution, resulting in up to 3.5x speedups on x86
architectures with AVX2 or AVX-512 instructions. This opt-in feature
requires NumPy to be built with the -Denable_openmp Meson flag. Users
can control the number of threads used by setting the OMP_NUM_THREADS
environment variable.
(gh-28619)
Performance improvements for
np.float16castsEarlier, floating point casts to and from
np.float16types wereemulated in software on all platforms.
Now, on ARM devices that support Neon float16 intrinsics (such as recent
Apple Silicon), the native float16 path is used to achieve the best
performance.
(gh-28769)
Changes
The vector norm
ord=infand the matrix normsord={1, 2, inf, 'nuc'}now always returns zero for empty arrays.Empty arrays have at least one axis of size zero. This affects
np.linalg.norm,np.linalg.vector_norm, andnp.linalg.matrix_norm. Previously, NumPy would raises errors orreturn zero depending on the shape of the array.
(gh-28343)
A spelling error in the error message returned when converting a
string to a float with the method
np.format_float_positionalhasbeen fixed.
(gh-28569)
NumPy's
__array_api_version__was upgraded from2023.12to2024.12.numpy.count_nonzeroforaxis=None(default) now returns a NumPyscalar instead of a Python integer.
The parameter
axisinnumpy.take_along_axisfunction has now adefault value of
-1.(gh-28615)
Printing of
np.float16andnp.float32scalars and arrays havebeen improved by adjusting the transition to scientific notation
based on the floating point precision. A new legacy
np.printoptionsmode'2.2'has been added for backwardscompatibility.
(gh-28703)
Multiplication between a string and integer now raises OverflowError
instead of MemoryError if the result of the multiplication would
create a string that is too large to be represented. This follows
Python's behavior.
(gh-29060)
unique_valuesmay return unsorted dataThe relatively new function (added in NumPy 2.0)
unique_valuesmay nowreturn unsorted results. Just as
unique_countsandunique_allthesenever guaranteed a sorted result, however, the result was sorted until
now. In cases where these do return a sorted result, this may change in
future releases to improve performance.
(gh-26018)
Changes to the main iterator and potential numerical changes
The main iterator, used in math functions and via
np.nditerfromPython and
NpyIterin C, now behaves differently for some bufferediterations. This means that:
sized allowed by the
buffersizeparameter.no operand requires buffering.
For
np.sum()such changes in buffersize may slightly change numericalresults of floating point operations. Users who use "growinner" for
custom reductions could notice changes in precision (for example, in
NumPy we removed it from
einsumto avoid most precision changes andimprove precision for some 64bit floating point inputs).
(gh-27883)
The minimum supported GCC version is now 9.3.0
The minimum supported version was updated from 8.4.0 to 9.3.0, primarily
in order to reduce the chance of platform-specific bugs in old GCC
versions from causing issues.
(gh-28102)
Changes to automatic bin selection in numpy.histogram
The automatic bin selection algorithm in
numpy.histogramhas beenmodified to avoid out-of-memory errors for samples with low variation.
For full control over the selected bins the user can use set the
binor
rangeparameters ofnumpy.histogram.(gh-28426)
Build manylinux_2_28 wheels
Wheels for linux systems will use the
manylinux_2_28tag (instead ofthe
manylinux2014tag), which means dropping support forredhat7/centos7, amazonlinux2, debian9, ubuntu18.04, and other
pre-glibc2.28 operating system versions, as per the PEP 600 support
table.
(gh-28436)
Remove use of -Wl,-ld_classic on macOS
Remove use of -Wl,-ld_classic on macOS. This hack is no longer needed by
Spack, and results in libraries that cannot link to other libraries
built with ld (new).
(gh-28713)
Re-enable overriding functions in the
numpy.stringsRe-enable overriding functions in the
numpy.stringsmodule.(gh-28741)
Checksums
MD5
SHA256
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.