一些numpy疑惑

np.int是int的别名

怎样输出numpy 矩阵数组,连续的n行n列?

3、格式化字符串函数

 
print("网站名:{name}, 地址 {url}".format(name="菜鸟教程", url="www.runoob.com"))
 
# 通过字典设置参数
site = {"name": "菜鸟教程", "url": "www.runoob.com"}
print("网站名:{name}, 地址 {url}".format(**site))
 
# 通过列表索引设置参数
my_list = ['菜鸟教程', 'www.runoob.com']
print("网站名:{0[0]}, 地址 {0[1]}".format(my_list))  # "0" 是必须的

4、矩阵乘法

矩阵乘积np.dot(a,b)

矩阵点乘np.multiply

矩阵*:好像有问题,不是矩阵乘积,而是点乘

矩阵点除 a/b

发布了110 篇原创文章 · 获赞 18 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/momo_mo520/article/details/102794304
今日推荐