NumPy 1.20 introduces type annotations

Major upgrade to the scientific package for Python also features expanded use of SIMD, increasing the execution speed of universal functions.

NumPy 1.20.0, described as the largest-ever release of the scientific computing package for Python, has arrived, introducing new capabilities such as type annotations and expanded use of SIMD (single instruction, multiple data).

Release notes for NumPy 1.20.0 indicate type annotations have been added for large parts of NumPy. There also is a new numpy.typing module containing useful types for end users. Currently available types include ArrayLike, for objects that can be coerced into an array, and DtypeLike, for objects that can be coerced into a dtype.

Wider use of SIMD in NumPy increases execution speed of universal functions (ufuncs). Work was done to introduce universal functions that will ease the use of modern features on different hardware platforms. In addition, improvements have been made to pave the way to NEP-38 (NumPy Enhancement Proposal) SIMD performance optimizations.

Other additions and improvements in NumPy 1.20.0 include:

Installation instructions for NumPy can be found at numpy.org. Language versions supported by NumPy 1.20.0 include Python 3.7 through Python 3.9; support has been dropped for Python 3.6.

Related:

Copyright © 2021 IDG Communications, Inc.