Recap:
Data analysis: the seemingly chaotic extracted some information about the data behind the study summed up
The inherent laws of objects
Three Musketeers data analysis: numpy, pandas, matplotlb
numpy is an extension library python language supports a number of dimensions of the array and matrix operations
In addition, also for the operation of the array, it provides a large library of mathematical functions
One: Create ndarray
Guide package
import numpy as np
1: Creating an array np.array ()
1 => 1: Create a one-dimensional array
np.array ([1,2,3,4,5 ])
Output:
Array ([ . 1, 2,. 3,. 4,. 5])
1 => 2: Create a two-dimensional array
in: np.array([[1,2,3],[4,'a',6],[6,7,8]]) out: array([['1', '2', '3'], ['4', 'a', '6'], ['6', '7', '8']], dtype='<U11')
Note: The default type for all data elements ndarray of numpy is the same.
If passed into ladies included in the list of different types, the type of unity is unity
priority:
str>float>int
2: Use the routines function to create np
It contains the following common method of creating:
2=>1:
np.ones (shape, dtype = None, order = 'c') to create an array of Junichi
in: np.ones(shape=(3,3)) out: Out[9]: array([[1., 1., 1.], [1., 1., 1.], [1., 1., 1.]])
2=>2:
np.zeros (shape, dtpye = None, order = 'c') to create an array of pure 0
in: np.zeros(shape=(3,3)) out array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])
2=>3:
np.full (shape, fill_value, dtype = None, order = 'c') to create a list of all the numbers are the same
in: np.full(shape=(3,3),fill_value=100) out: array([[100, 100, 100], [100, 100, 100], [100, 100, 100]])
2=>4:
np.lispace(start,stop,num=50,endpoint=True. retstep=False, dtype=None)
Arithmetic progression
np.linspace (1.100, num = 20)