Data

NumPy 1.16 is here and it’s the last release to support Python 2.7

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, system for linear algebra built on a serverless architecture

Natasha Mathur

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

Share
Published by
Natasha Mathur

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago