Start studying: Saturday, December 7th Books used: Miyuki Oshige "Details! Python3 Introductory Note ”(Sotec, 2017)
Resume from [text file (Ch.13 / p.316)](8th day), Finished until [Numpy array (Ch.15 / p.380)](9th day)
-Use the matplotlib.pyplot module -Although it can be set in plt.plot (X-axis, Y-axis), an error occurred if the number of ** elements did not match. ** ** -Plt.title is the title of the graph, plt.xlabel (ylabel) is the title of the axis -A plot marker can be added to the third argument of plt.plot with marker = "o". ・ Color and linestyle can be set with the 4th and 5th arguments of plt.plot. -A legend can be added with plt.legend (loc = "location"). ・ Bar for vertical bar, barh for horizontal bar, xticks for stacked bar, scatter for scatter plot, pie for circle
Numpy -Create an array with array (). You can create as many matrices as there are arguments. -Fill it into 4 characters with dtype = "<U4".
>>print(np.array([1,2,3], [4,5,6], [7,8,9]))
ValueError: only 2 non-keyword arguments accepted
#argument(arguments)Are you missing two?
>>>print(np.array([[1,2,3], [4,5,6], [7,8,9]]))
#If you do the above, it will be solved, the entire list[]It was big.
-The one-dimensional array output by np.array () can be converted by .reshape (row, column). -You can convert a multidimensional array to a one-dimensional array with ravel () or flatten (). -Np.append (array, value, axis = none) Add a row with axis 0 and a column with 1 -Matrix transpose is .transpose ()
-Available in array [index number] ・ Slices are possible just like lists -It is possible to specify the numerical value to be taken out by the conditional expression. a [a> = 5] etc. Conditional classification using logical operators. Logical product, logical sum, logical negation
-Calculation is possible as usual with operators. With a function called broadcast, it is added or subtracted from all elements. -Can also be applied to 2D vector calculation. Absolute value can be calculated with linalg.norm () -Sum () can be used to get the total sum, sum (0) can be used to get the total for each column, and sum (1) can be used to get the total for each row.
-You can create an array with numpy.arrange (open price, close price, skip). Only the closing price cannot be omitted. -You can create an array with the number of divisions specified by numpy.linspace (open price, close price, skip). -Create an identity matrix of X rows and X columns with numpy.identity (X) or eye (X). ・ Poisson distribution can also be created. What is the Poisson distribution ... study required -Data read by read_csv () of pandas () becomes DataFrame type and can be read.
Recommended Posts