Screenshot 2021-06-07 105759.jpg

Do you know that the word "mean" has many meanings? Today we are going to introduce the word mean and its related functions.

The functions np.mean(a, axis=None, dtype=None, out=None, keepdims=False) and np.average(a, axis=None, weights=None, returned=False) provide us with a number of parameters, but the biggest difference is that np. The biggest difference is that np.average() provides a weight ratio (weights=False) while np.mean() provides axis retention (keepdims=False).

The parameter, (weights), provides us with the right to assign weights. If weights are not set again, the weight of each data item will be 1.

The parameters, (returned), give us the combination of weights to calculate.

The parameters, (keepdims), allow us to retain the original shape of the data.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-06-04 125834.jpg

This time we introduce the functions for calculating absolute values, np.abs() and np.fabs(). The functions np.abs() and np.absolute() are the same. In addition, the difference between np.abs() and np.fabs() is that the former can handle complex numbers, so calculating complex content in np.fabs() will result in an error message.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-06-01 132111.jpg

This section will introduce the approximation function in two parts. These functions are quite simple to use and can be completed by simply dropping the value to be processed into the parameter. The explanations are given in the diagrams.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-06-02 142007.jpg

The final part of the approximation function. These functions are quite simple to use and can be completed by simply dropping the value to be processed into the parameter. The explanations are given in the diagrams.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()


This is an introduction to the hyperbolic functions. Since hyperbolic functions have equivalent properties to trigonometric functions, you will see the words sin, cos, tan, and NumPy also provides functions for inverse hyperbolic functions. To use it, simply drop the value into the parameter.

Note:

sinh x = -e^(-x)/2 

cosh x = +e^(-x)/2

tanh x = sinhx/coshx

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-28 151657.jpg

This time the functions are np.exp(x) and np.log(y), which are the exponential and logarithmic functions respectively. I believe you have some understanding of these functions in high school, so I won't explain the process here.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-27 123454.jpg

In everything there is a positive and a negative, a black and a white.Last time we introduced np.sin(), np.cos(), and np.tan(), and this time we will introduce the inverse trigonometric functions np.arcsin(), np.arccos(), and np.arctan().  So once you have obtained the result of np.sin(), you can use np.arcsin() to deduce it back.

We also mentioned the concept of degrees and radians earlier, and NumPy provides conversions for both, np.deg2rad() and np.rad2deg(), which is literally what this function is used for. The rest is up to you to do.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-26 132440.jpg

In this presentation, we will introduce the trigonometric functions, without further explanation of the operations involved. However, it is important to note that the value entered in the parameter is in radians, not degrees.

In the next section, we will introduce inverse trigonometric functions, etc.

Note: 1 radian = 180/ 𝝿; 1 degree = 𝝿/180.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-25 095812.jpg

Here we are going to talk about today is np.power(x,t) and np.sqrt(x), which are other basic functions in arithmetic.

First, np.power(x,t), we can also type x**t that we'll obtain the power of x, e.g. 2*np.power(2,3) is the same as 2**3, the answer will be 8.

Last one, np.sqrt(x), which means that x square root. If you are not sure how to get the process of calculation, go find it online.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-24 095242.jpg

Similarly, we can calculate multiplication, division, quotients and remainders by using the operators *, /, //, % or with NumPy function np.mutiply(), np.divide(), np.mod(). We do not need to explain how to use them in the same way as addition and subtraction.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-23 211002.jpg

We can add, subtract, multiply, divide and mod directly using program operators. Of course, numpy also offers them, both of which are the same thing.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

Screenshot 2021-05-22 194543.jpg

np.r_ also provides us with the function np.array(), which is inconvenient to use and you can go back and review if you forget.

Finally, there is the parameter 'r/c' which allows us to do an array merge of rows or columns. Because of this parameter, np.r_ provides us with the functionality of np.c_. If we understand the logic of np.r_, then we don't need to learn more about np.c_ to mess up our thinking.

Wayneezzzz 發表在 痞客邦 留言(0) 人氣()

1 2 3 4
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。