v1.24.0
NumPy 1.24 Release Notes
The NumPy 1.24.0 release continues the ongoing work to improve the
handling and promotion of dtypes, increase the execution speed, and
clarify the documentation. There are also a large number of new and
expired deprecations due to changes in promotion and cleanups. This
might be called a deprecation release. Highlights are
- Many new deprecations, check them out.
- Many expired deprecations,
- New F2PY features and fixes.
- New "dtype" and "casting" keywords for stacking functions.
See below for the details,
This release supports Python versions 3.8-3.11.
Deprecations
Deprecate fastCopyAndTranspose and PyArray_CopyAndTranspose
The numpy.fastCopyAndTranspose
function has been deprecated. Use the
corresponding copy and transpose methods directly:
arr.T.copy()
The underlying C function PyArray_CopyAndTranspose
has also been
deprecated from the NumPy C-API.
(gh-22313)
Conversion of out-of-bound Python integers
Attempting a conversion from a Python integer to a NumPy value will now
always check whether the result can be represented by NumPy. This means
the following examples will fail in the future and give a
DeprecationWarning
now:
np.uint8(-1)
np.array([3000], dtype=np.int8)
Many of these did succeed before. Such code was mainly useful for
unsigned integers with negative values such as np.uint8(-1)
giving
np.iinfo(np.uint8).max
.
Note that conversion between NumPy integers is unaffected, so that
np.array(-1).astype(np.uint8)
continues to work and use C integer
overflow logic. For negative values, it will also work to view the
array: np.array(-1, dtype=np.int8).view(np.uint8)
. In some cases,
... (truncated)