Nump learning np.empty() function

The syntax of the np.empty() function is as follows: 

empty(shape[, dtype, order]) 

According to the given shape, and data type dtype, return a one-dimensional or multi-dimensional array. The elements of the array are not empty and are randomly generated data. 

The parameters are explained as follows:

shape: The shape of the returned array defined by an integer or integer tuple. 

dtype: data type, defines the type of the returned array, optional. Such as dtype = int

order: {'C','F'}, specifies the storage order of the returned array elements in the memory. Optional. C-rowmajor; F-columnmajor

As shown in the following example, output a 3x3 floating-point array.

If there are requirements for the value of the elements in the array, for example, if you want to set it to 1, you can use .fill() to achieve:

 

Undertake programming in Matlab, Python and C++, machine learning, computer vision theory implementation and guidance, both undergraduate and master's degrees, salted fish trading, professional answers please go to know, please contact QQ number 757160542 for details, if you are the one.

 

Guess you like

Origin blog.csdn.net/weixin_36670529/article/details/114298302