矩阵乘法(下)
现在来检验一下您的矩阵乘法技能。
本练习是课程的一部分
使用 PySpark 构建推荐引擎
练习说明
- 使用
.shape属性查看矩阵C和D的维度,并判断它们是否可以相乘。 - 如果可以相乘,请使用
np.matmul()进行相乘;如果不可以,将C_times_D设为None。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Print the dimensions of C
print(____.____)
# Print the dimensions of D
print(____.____)
# Can C and D be multiplied together?
C_times_D = ____