NumPy Scientific Computing Python Library 2.0.0 Released

NumPy 2.0.0, a Python library for scientific computing, is now available, which is focused on working with multidimensional arrays and matrices, and also provides a large collection of functions with the implementation of various algorithms related to the use of matrices. NumPy is one of the most popular libraries used for scientific computing. The project code is written in Python with C optimizations and distributed under the BSD license.

NumPy 2.0.0 marks the first significant release since 2006.
In the new version, in addition to new features and performance optimizations, changes have been made to the ABI, Python API and C-API, which violate backward compatibility. For example, the SciPy library compiled with NumPy 1.x will require recompilation to work with NumPy 2.0. In some cases, code changes may be required to use NumPy 2.0 in applications.

The most significant bug is related to the preservation of precision of scalar expressions, for example, "np.float32(3) + 3" will now return a value of type float32, not float64, and in expressions with multiple types, the type with the highest precision will be used for the result, i.e. "np.array([3], dtype=np.float32) + np.float64(3)" will return a value of type float64. The default integer types used on the platform have been changed. Windows β€” on 64-bit systems, a 64-bit integer type is now used, and on 32-bit systems, a 32-bit type (previously, the C-type analogue long was used, but now the equivalent np.intp).

Some definitions in the C-API have been replaced or removed, for example, the PyArray_Descr structure has been changed. The maximum number of dimensions and arguments set through the NPY_MAXDIMS and NPY_MAXARGS macros has been increased to 64. All complex types have been switched to using standard types from the C99 specification (cfloat_t, cdouble_t, clongdouble_t). Added new C API for creating custom dtypes. New simplified initialization functions PyArray_ImportNumPyAPI and PyUFunc_ImportUFuncAPI have been proposed.

The Python API provides a more explicit separation between public and private APIs and introduces a new module structure. About 100 functions, modules, and constants have been moved out of the main "np" namespace, deprecated, or removed.
Cleaned up the np.lib namespace. The number of objects in the main namespace has been reduced by 10%, and in the numpy.lib namespace by 80%. The numpy.core namespace has been moved to private. Removed some methods from np.ndarray and np.generic classes. Created a new namespace numpy.stringsf with string operations.

New features include support for float32 and longdouble types in all numpy.fft functions, support for the standard Array API in the main namespace, a new namespace and types for variable length strings. Performance optimization has been carried out using the Intel x86-simd-sort and Google Highway libraries for the string functions sort, argsort, partition and argpartition, operations with fixed strings in the numpy.char module have been accelerated. New API added
opt_func_info for tracing and introspection.

Source: opennet.ru

Buy reliable hosting for sites with DDoS protection, VPS VDS servers πŸ”₯ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster