import numpy as np
Creating a sample numpy array (in 1D)
ary = np.arange(1, 25, 1)
Converting the 1 Dimensional array to a 2D array
(to allow explicitly column and row operations)
ary = ary.reshape(5, 5)
Displaying the Matrix (use print(ary) in IDE)
print(ary)文章来源:https://www.toymoban.com/news/detail-815718.html
This for loop will iterate over all columns of the array one at a time
for col in range(ary.shape[1]):
print(ary[:, col])文章来源地址https://www.toymoban.com/news/detail-815718.html
到了这里,关于遍历数组的列的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!