[PYTHON] Learning record No. 17 (21st day)

Learning record (21st day)

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) ~

"Introduction to Data Analysis with Python"

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

Learning record No. 17 (21st day)
Learning record No. 27 (31st day)
Learning record No. 21 (25th day)
Learning record No. 10 (14th day)
Learning record No. 18 (22nd day)
Learning record No. 24 (28th day)
Learning record No. 19 (23rd day)
Learning record No. 29 (33rd day)
Learning record No. 28 (32nd day)
Learning record No. 23 (27th day)
Learning record No. 25 (29th day)
Learning record No. 26 (30th day)
Learning record No. 20 (24th day)
Learning record No. 14 (18th day) Kaggle4
Learning record No. 15 (19th day) Kaggle5
Learning record 4 (8th day)
Learning record 9 (13th day)
Learning record 3 (7th day)
Learning record 5 (9th day)
Learning record 6 (10th day)
Programming learning record day 2
Learning record 8 (12th day)
Learning record 1 (4th day)
Learning record 7 (11th day)
Learning record 2 (6th day)
Learning record 16 (20th day)
Learning record 22 (26th day)
Learning record 13 (17th day) Kaggle3
Learning record 12 (16th day) Kaggle2
Learning record
Learning record # 3
Learning record # 1
Learning record # 2
Learning record 11 (15th day) Kaggle participation
Python learning day 4
Learning record (2nd day) Scraping by #BeautifulSoup
Learning record so far
Linux learning record ① Plan
Effective Python Learning Memorandum Day 15 [15/100]
<Course> Deep Learning: Day2 CNN
Effective Python Learning Memorandum Day 6 [6/100]
Effective Python Learning Memorandum Day 12 [12/100]
Effective Python Learning Memorandum Day 9 [9/100]
Effective Python Learning Memorandum Day 8 [8/100]
Learning record (3rd day) #CSS selector description method #BeautifulSoup scraping
Rabbit Challenge Deep Learning 1Day
<Course> Deep Learning: Day1 NN
Effective Python Learning Memorandum Day 14 [14/100]
Effective Python Learning Memorandum Day 1 [1/100]
Subjects> Deep Learning: Day3 RNN
Rabbit Challenge Deep Learning 2Day
Effective Python Learning Memorandum Day 13 [13/100]
Effective Python Learning Memorandum Day 3 [3/100]
Effective Python Learning Memorandum Day 5 [5/100]
Effective Python Learning Memorandum Day 4 [4/100]
1st month of programming learning
Effective Python Learning Memorandum Day 7 [7/100]
Effective Python Learning Memorandum Day 2 [2/100]
Thoroughly study Deep Learning [DW Day 0]
Learning record (4th day) #How to get the absolute path from the relative path