线性代数向量内积_向量的点积| 使用Python的线性代数

本教程介绍了线性代数中的向量内积概念,强调了向量必须具有相同维度才能进行点积运算。通过Python的内置函数展示了如何计算两个向量的点积。
摘要由CSDN通过智能技术生成

线性代数向量内积

Prerequisite: Linear Algebra | Defining a Vector

先决条件: 线性代数| 定义向量

Linear algebra is the branch of mathematics concerning linear equations by using vector spaces and through matrices. In other words, a vector is a matrix in n-dimensional space with only one column.

线性代数是使用向量空间和矩阵的线性方程组的数学分支。 换句话说,向量是n维空间中只有一列的矩阵。

In this tutorial, we are going to learn the Dot product of two vectors. The dot product of two vectors is only possible when both have the same dimensions.

在本教程中,我们将学习两个向量点积两个向量点积只有在两个向量的尺寸相同时才可能。

Syntax:

句法:

    dot_product = Vecotr_1.dot(Vector_2)

This is an inbuilt function for dot product of two vectors.

这是两个向量的点积的内置函数。

使用Python代码查找向量的点积 (Python code to find the dot product of vectors)

# Linear Algebra Learning Sequence
# Dot Product of Vectors

import numpy as np

# Use of np.array() to define an Vector
V = np.array([323,623,823])
print("The Vector A : ",V)

VV = np.array([3,63,78])
print("\nThe Vector B : ",VV)

pro = V.dot(VV)

print("Product of two vectors : ", pro)

Output:

输出:

The Vector A :  [323 623 823]

The Vector B :  [ 3 63 78]
Product of two vectors :  104412


翻译自: https://www.includehelp.com/python/dot-product-of-vectors.aspx

线性代数向量内积

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值