cf小号自助购买网站,做农资的网站,外包网易,wordpress百度云存储线性代数向量内积Prerequisites: 先决条件#xff1a; Defining Vector using Numpy 使用Numpy定义向量 Learn: how to code for outer product of two vectors using am inbuilt function in numpy library? 了解#xff1a;如何使用numpy库中的内置函数为两个向量的外部乘…线性代数向量内积Prerequisites: 先决条件 Defining Vector using Numpy 使用Numpy定义向量 Learn: how to code for outer product of two vectors using am inbuilt function in numpy library? 了解如何使用numpy库中的内置函数为两个向量的外部乘积编码 Syntax: 句法 numpy.outer(Vec_1, Vec_2)
向量外积的Python代码 (Python code for outer product of vectors) # Linear Algebra Learning Sequence
# Outer Product
import numpy as np
a np.array([2,3,4,1])
b np.array([5,4,-6,45,7])
outpro np.outer(a,b)
print(Vector A : , a)
print(Vector B : , b)
print(Outer product of Vector A and Vector B :, outpro)
Output: 输出 Vector A : [2 3 4 1]
Vector B : [ 5 4 -6 45 7]
Outer product of Vector A and Vector B : [[ 10 8 -12 90 14]
[ 15 12 -18 135 21]
[ 20 16 -24 180 28]
[ 5 4 -6 45 7]]
翻译自: https://www.includehelp.com/python/outer-product-of-vectors.aspx线性代数向量内积