NumPy Base: Array and Vector computing NumPy Ndarray: a multidimensional Array object
This object is a fast and flexible large data set container. You can use this array to perform some mathematical operations on the whole piece of data, which is the same syntax as a scalar element.
List conversions to arrays
Two-dimensional list
Data type
Some other auto-generated arrays
Arange ()
Data types for Ndarray
Using the Astype () method to convert a type, if a floating-point number is converted to an integer, the fractional part is truncated, and if a string array is full of numbers, it can also be converted to numeric form
Operations between arrays and scalars
Arrays are important because they allow you to perform bulk operations on the main clause without having to write loops. This is often called vectorization. Any arithmetic operation between arrays of equal size applies the operation to the element level.
The array is the product of each number in the corresponding position, and the array can be subtraction with the scalar.
The operations between arrays of different sizes are called broadcasts.
Basic indexes and slices
Like a list in Python, an array slice is a view of the original array.
Arr[0][2]arr[0,2] These two are the same
Boolean index
You can use! =,-, or &,| to perform the operation.
Fancy Index
Refers to the use of an integer array for indexing.
Array Transpose and Axisymmetric
Arr. T
Np.dot (arr. T,arr) Calculating the inner product
The transpose of the high-level array is not quite clear.
There is also a swapaxes method that needs to accept a pair of axis numbers. Don't quite understand
General functions: Fast element Progression Group functions
Using Arrays for data processing
Vectorization: The practice of replacing loops with array expressions.
"Data analysis Using Python" chapter 4th study Notes