矩阵乘法(II)
来检验一下您对矩阵乘法的掌握情况。
本练习是课程的一部分
使用 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 = ____