Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new features of NumPy

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "what are the new features of NumPy". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the new features of NumPy.

As an extension library of Python language, NumPy supports a large number of dimensional array and matrix operations, and also provides a large number of mathematical function libraries for array operations. Since the launch of the original version, NumPy has become an expansion package for Python scientific computing. Today, it is the most widely used in calculating multidimensional arrays and large arrays. In addition, it also provides multiple functions, operates arrays efficiently, and can be used to implement advanced mathematical operations.

Recently, NumPy has been updated. According to NumPy officials, NumPy v1.20 is the largest version update to date, with a total of 184developers contributing about 684 PR, adding new features such as type annotations and sliding window views.

The new version supports Python 3.7-3.9, but does not support Python 3.6. The main highlights are as follows:

Comments on NumPy function

Expand the scope of use of SIMD and improve the execution speed of ufuncs (Universal Functions)

Preparation for changing data types and casting implementations to provide an easier way to extend data types

Documentation improvements, including approximately 185PR mergers

Further cleanup on removing Python 2.7s (cleanups), which improves the readability of the code and eliminates the technical burden

Provide initial support for the upcoming Cython 3.0.

New online function

The newly released version 1.20.0 of NumPy includes the following three new functions:

(1) the random.Generator class has a new function permuted. The new function differs from shuffle and permutation in that a subarray of a given axis index is converted. For example, you can now convert the rows or columns of a two-dimensional array

(3) A new user-oriented (user-facing) function numpy.broadcast_shapes. This function can obtain the shape from a given shape tuple through broadcasting, in which the function of broadcasting mechanism is to facilitate the mathematical operation of array of different shape.

Deprecated function

Aliases for built-in types (builtin type) such as np.int have been deprecated. For a long time, np.int was an alias for int, but it often caused trouble for beginners, mainly for historical reasons.

The following table shows a complete list of deprecated aliases, with the third column as an alternate NumPy name.

In addition, passing shape=None to functions with non-optional arguments shape has been deprecated, imprecise matches of mode and searchside, and numpy.dual modules have been deprecated.

At this point, I believe you have a deeper understanding of "what are the new features of NumPy?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report