Available Python library release for scientific calculations numpy 2.0.0 is now out. Focused on working with multidimensional massifs and matrices, this update provides a wide range of functions implementing various algorithms associated with the use of matrices. Numpy is renowned as one of the most popular libraries utilized for scientific calculations. The project is coded in the Python language and is distributed under the BSD license.
Numpy 2.0.0 marks the first significant release since 2006. In this new version, besides adding new capabilities and enhancing performance, modifications have been made to the Python API and C-API, which may disrupt reverse compatibility. With changes like this, for example, cross-compilation may be required for using the Scipy library alongside Numpy 2.0. In certain situations, code adjustments may be necessary for the implementation of Numpy 2.0.
A major change pertains to maintaining scalar expression accuracy. For instance, “NP.Float32(3) +” will now return the value with the float32 type instead of Float64. Additionally, in expressions involving multiple types for the result, the type with the highest accuracy will be utilized. Integer types on Windows platform have also undergone modifications, with a 64-bit system now using a 64-bit integer type, as opposed to the previous usage of an analogue of the LONG type.
Several definitions in the C-API have been replaced or eliminated, such as alterations to the Pyarray_Descr structure. The maximum number of dimensions and arguments displayed through NPY_MAXDIMS and NPY_MAXARGS macros now extends to 64. All complex types have transitioned to using full-time types from the C99 specification. New API functions have been introduced for easier initialization and creation of custom dtypes.
The Python API now offers a clearer distinction between public and private API, presenting a new module structure. Approximately 100 functions, modules, and constants have been moved from the main NP namespace, declared as outdated or removed. The numpy.lib namespace has also undergone cleanup operations. Object count in the main namespace has reduced by 10%, while in the numpy.lib namespace, it has diminished by 80%. Numpy.core names have been shifted to the private category, and certain methods from NP.ndarray and NP.generic classes have been