2 min read

Python team released NumPy version 1.16 last week. The latest release explores new features, deprecations, and other improvements. NumPy 1.16 is the last release to support Python 2.7 and it will be maintained as a long term release with the bug fixes until 2020. Let’s have a look at some of the major highlights of this release.

New features

  • Integrated squared error (ISE) estimator has been added to histogram in NumPy 1.16. ISE is a non-parametric method that is based on cross-validation.
  • NumPy 1.16 comes with max_rows keyword which has been added for np.loadtxt. This sets the maximum rows for the content to be read after skiprows, as in numpy.genfromtxt.
  • New modulus operator support added for np.timedelta64 operands. These operands may have different units and the return value will always match the type of the operands.
  • NumPy 1.16 offers improved support for the ARM CPUs. They can now accommodate 32 and 64 bit targets, and also big and little-endian byte ordering.
  • The matmul function is now a ufunc, meaning that both the function and the __matmul__ operator can now be overridden by __array_ufunc__. The implementation of matmul function has also been changed and uses the same BLAS routines as numpy.dot.

New Deprecations

  • In NumPy 1.16, type dictionaries numpy.core.typeNA and numpy.core.sctypeNA have been deprecated. These type dictionaries were buggy and will be removed in the 1.18 release. Users can make use of `numpy.sctypeDict` instead.
  • The numpy.asscalar function has been deprecated.
  • The numpy.set_array_ops and numpy.get_array_ops functions are also deprecated.
  • The numpy.unravel_index keyword argument dims is deprecated, users can use shape instead.

Other improvements and changes

    • NumPy builds can no longer interact with the host machine shell directly in NumPy 1.16. The exec_command has been replaced with subprocess.check_output.

 

  • Earlier, a LinAlgError used to be raised during cases when empty matrix/empty matrices (with zero rows and/or columns) were passed in. Now linalg.lstsq, linalg.qr, and linalg.svd can work with empty arrays.

 

  • numpy.angle and numpy.expand_dims can now work on ndarray subclasses in NumPy 1.16.

 

 

  • +array is now enabled with raising a deprecation warning for non-numerical arrays Earlier, +array unconditionally returned a copy.
  • NDArrayOperatorsMixin can now implement matrix multiplication.

For more information, check out the official release notes.

Read Next

NumPy 1.15.0 release is out!

NumPy drops Python 2 support. Now you need Python 3.5 or later.

Introducing numpywren, a system for linear algebra built on a serverless architecture

Tech writer at the Packt Hub. Dreamer, book nerd, lover of scented candles, karaoke, and Gilmore Girls.