Data analysis was performed using the Python Chapter 4 NumPy base - Calculation of the quantization array (2)

2.3 NumPy array operation

Array without writing cycle can perform bulk operations on the data! This feature is called NumPy users vectorization (vectorization).

(1) between arithmetic operation will be equal to the size of the array is applied to the operational element level

 

 (2) an array of scalar arithmetic scalar value to each element of the propagation

 

 PS: ** denotes exponentiation in python, e.g., 3 2 ** 3 represents power of 2

(3) can be compared by the size of the array to generate the same array of boolean values

 

 (Operations between arrays of different sizes called the broadcast, the book does not need to broadcast multi-depth understanding of the mechanism)

 

2.4 The basic indexing and slicing

Important difference is that the array with the list: an array slice is a view of the original array, which means that data is not copied, the man in view of any changes will be directly reflected in the source array.

 

Guess you like

Origin www.cnblogs.com/ElonJiang/p/11621767.html