NumPy 2.0 brings API/ABI breaking changes, new features, and performance improvements
NumPy, a fundamental package for scientific computing in Python, has released version 2.0, marking its first major update since 2006. This significant update introduces breaking changes, including an ABI break, modified type promotion rules, and API changes not flagged in prior 1.26.x deprecation warnings.
Key features of this release are the new variable-length string dtype, StringDType, and a numpy.strings namespace equipped with efficient ufuncs for string operations. Additionally, numpy.fft functions now support float32 and longdouble, while the main numpy namespace aligns with the array API standard.
The update also enhances Python and C API functionalities, boosts performance, refines type promotion behavior, and offers improved documentation. On Windows, the default integer type shifts from int32 to int64, aligning with other platforms, and the maximum array dimensions increase from 32 to 64. Additionally, NumPy continues its transition from C to C++, aiming to streamline future maintenance and improvements.