Numpy study notes 02 - core array object

1. The properties of the array itself

 

  • shape: returns a tuple representing the dimension of the array
  • ndim: a number indicating the number of dimensions of the array
  • size: a number indicating the number of all data elements in the array
  • dtype: the data type of the elements in the array

 

Second, the method of creating an array

  • Created from python's list list and nested list
  • Created using predetermined functions such as arange, ones/ones_like, full/full_like, eye, etc.
  • np.random module build for generating random numbers

 

 

 

3. Commonly used functions of array

  • Arithmetic operations such as element-wise addition, subtraction, multiplication, and division
  • Better multidimensional array indexing
  • Find aggregation functions such as sum
  • Linear algebra functions, such as solving inverse matrices, etc.

 

Guess you like

Origin blog.csdn.net/weixin_47930147/article/details/121075307