The book "Data analysis using Python"
numpy--arrays and matrices, vector computing
1, Ndarray multidimensional arrays, matrix matrices
2, for the whole set of data for fast operation of the standard mathematical (statistical) function, (and list difference: no need to loop to write programs)
3. Tools for reading and writing disk data tools and operating memory mapping files
4. Linear algebra, random number generation and Fourier transform
5, based on the C language API, has a good operating rate
create function
Array |
input data converted to Ndarray (dtype optional) |
arrange |
built-in range returns Ndarray |
zeros/zeros_like |
Returns a full 0 array, or a reference to other arrays of shape and Dtype, based on the specified shape and dtype |
Eye |
create n*n unit matrix |
ones/ones_like |
Returns a full 1 array, or a reference to other arrays of shape and Dtype, based on the specified shape and dtype |
empty/empty_like |
allocates only space but does not populate any values |
basic functions
dtype |
Data type Dtype (customizable type) Note: Complex complex must not be converted to integers |
shape |
|
reshape |
|
Ravel |
|
transpose/t |
array transpose |
stack/hstack/vstack/dstack/concatenate/ |
|
ix_ |
Select an indexer for a square area, a fancy index x[ix_ ([0,1],[0,1])]=x[[0,1]][:,[0,1]] |
statistics function
Sqrt/square/lo G/sign |
|
min/max/ptp/sum |
|
mean/va R/STD |
|
argmin/argmax |
min Max index |
any/all |
Whether there is one or more true/arrays in the array that are all true |
average |
|
m Edian |
|
sort |
|
in1d |
test If the value in one array is in the membership of another array, returns the bool array |
unique/intersect1d/union1d/setdiff1d/setxor1d |
|
file input and OUTPUT functions
Loadtxt/savetxt |
|
Save/load |
Saves the array as a binary format disk or read (NPY) |
Savez |
Save multiple arrays to a compressed file |
Linear algebraic functions (LINALG)
Dot |
Matrix Inner Product XTX |
Qr |
QR decomposition |
Inv |
Inverse matrix |
Svd |
Singular decomposition SVD |
Eig |
Eigenvalues and eigenvectors |
Det |
Matrix determinant |
Random number function (randomness)
Normal (SHAPE) |
Normal distribution array with shape specification |
Randint/rand/randn |
|
Seed |
|
Note: Operations between different shape arrays are called broadcasts
pands--builds on NumPy, providing advanced data structures and operational tools
Using Python data to analyze-numpy and pands articles