When I start studying Numpy and find out how to specify arguments and usage examples, I will forget it. I will update it from time to time and use it as a memo pad. Please note that the order and comprehensibility are secondary, so it may be difficult to understand. After a quick look, Numpy is a library that specializes in numerical calculations, so It seems that there are many functions for calculation
Suguremono that uses the four arithmetic operations of python +,-, *, / to perform four arithmetic operations on each element of the array. It calculates without taking out the elements one by one. Recently, I've been touching pandas for a long time, so I didn't notice it, but my senior advised me to use numpy so much that I could remember it, so I think I'll try to remember it while playing around.
<np.array(object, dtype=None)>
array.py
#np.array()Generate ndarray with
A = np.array([1,3,5,7,9])
#--->array([1, 3, 5, 7, 9])
A -= 4
#---> array([-3, -1, 1, 3, 5])
#4 is subtracted for each element.
It's amazing that each element is subtracted This seems to have something to do with broadcast (more on that later) It seems that object will contain the type array_like. The array_like is an array represented by multiple lists and tuples in addition to ndarray. This ndarray is a class for n to handle __n-dimensional __arrays Since ndarray must basically consist of all elements of the same type, Pandas is easier to handle when working with arrays containing multiple data types (numeric types, strings, etc.)
<np.dot>
np.dot
a = np.array([1,2,3])
b = np.array([3,4,5])
#---> 26
Product of one-dimensional arrays
a = np.array([[1,2],
[4,5],
[1,2]])
b = np.array([[4,6,7],
[6,5,3]])
x = np.dot(a,b)
---------------------
#result
array([[16, 16, 13],
[46, 49, 43],
[16, 16, 13]])
x.dtype: int64
x.ndim:Number of dimensions:2
x.shape: (line,Column):(3, 3)
<np.maximum>
<np.max> <np.exp>