Start studying: Saturday, December 7th
Teaching materials, etc .: ・ Miyuki Oshige "Details! Python3 Introductory Note ”(Sotec, 2017): Completed on Thursday, December 19th ・ Progate Python course (5 courses in total): Ends on Saturday, December 21st ・ Andreas C. Müller, Sarah Guido "(Japanese title) Machine learning starting with Python" (O'Reilly Japan, 2017): Completed on Saturday, December 23 ・ Kaggle: Real or Not? NLP with Disaster Tweets: Posted on Saturday, December 28th to Friday, January 3rd Adjustment ・ ** Wes Mckinney "(Japanese title) Introduction to data analysis by Python" (O'Reilly Japan, 2018) **: January 4th (Sat) ~
p.134 Finish reading Chapter 4 Basics of Numpy.
-NumPy (Numerical Python): Interpreted in the sense of numerical Python High-speed calculation and data manipulation using vectorization notation It doesn't handle mathematical modeling and analytical techniques, but mastering it can be a weapon when using array-oriented tools like pandas. Serves as an interface to low-level languages such as C and Fortran
・ Ndarray: N-dimensional array object, contributing to fast and flexible data processing in Python environment Generated by array, the estimated data type is used, but the data type can be specified by dtype. Type conversion (cast) is possible with astype.
-By using vector operation, it is not necessary to write a loop type. (= High-speed operation)
・ Slicing (cutting / extracting some elements) Slices for a two-dimensional array are cut out along the axis. (Slightly different from slices of multidimensional arrays.) When the slice is mixed with scalars, the dimension goes down. You can understand it well by taking it out with shape. (3,) → 3 elements. (1, 3) → 1x3 matrix. P.108
・ One-dimensional boolean array Numerical assignment etc. is possible only for those specified by ndarray (those that are true) data [names! ='A'] = 7 Substitute 7 only for those whose names are not A, etc. This kind of operation is often used in the pandas environment.
-Calculation of inner product using the translocation matrix (np.dot) Translocation is performed in .T. Dot product calculation of X with X.T.dot (X). Partial replacement of the matrix is also possible by giving the order of the axes to the argument of transpose.
-Unary ufunc (abs, sqrt, log ...), binary ufunc (add, divide, maximum ...)
-Vector operation of python ternary operator A if condition else y can be performed in np.where. Set the truth judgment (conditional expression) in the first argument, True in the second argument, and False in the third argument, and return the corresponding one.
・ Dimension reduction is possible with aggregation processing (statistical functions) such as sum and mean.
-A set function such as np.unique can sort and output the values after removing duplicates in the array. (Like used in Kaggle preprocessing)
-Linear algebra can be calculated with the np.linalg module. Determinant, inverse matrix for square matrix, QR decomposition ...
・ Calculations based on various types of probability distributions are possible with np.random. Binomial distribution, normal distribution ... It is provided as a complement to Python's built-in random.
Recommended Posts