Python遍历numpy数组

本篇博客主要介绍如何遍历numpy数组。数组 下面是示例代码:code import numpy as np num = np.zeros([2, 3]) [rows, cols] = num.shape print(rows, cols) for i in range(rows): for j in range(cols): print(num[i, j]) 运行结果:博
相关文章
相关标签/搜索