四則演算
import numpy as np
vec1 = np.array([1, 2, 3])
vec2 = np.array([4, 5, 6])
print(vec1 + vec2) # [5 7 9]
print(vec1 - vec2) # [-3 -3 -3]
print(vec1 * vec2) # [ 4 10 18] ※アダマール積
print(vec1 / vec2) # [0.25 0.4 0.5 ]
内積
import numpy as np
vec1 = np.array([1, 2, 3])
vec2 = np.array([4, 5, 6])
print(np.dot(vec1, vec2)) # 32