为了进行图像分析,我用scipyimread加载了一个浮动图像。你知道吗
接下来,我让scipys argrelmax搜索轴0和1中的局部极大值,并将结果存储为元组数组。你知道吗
data = msc.imread(prediction1, 'F')
datarelmax_0 = almax(data, axis = 0)
datarelmax_1 = almax(data, axis = 1)
如何从两个列表创建一个numpy数组,其中只包含两个列表中的元组? 编辑: argrelmax创建一个包含两个数组的元组:
datarelmax_0 = ([1,2,3,4,5],[6,7,8,9,10])
datarelmax_1 = ([11,2,13,14,5], [11,7,13,14,10])
在中,您希望创建如下所示的numpy数组:
result_ar[(2,7),(5,10)]
这种“天真”的方式怎么样?你知道吗
很简单。也许有一个更好/更快/更奇特的方法,使用一些numpy方法,但现在应该可以了。你知道吗
编辑: 要回答已编辑的问题,可以执行以下操作:
这给你
如果使用
看起来是这样的:
如果您对zip的功能感兴趣:
相关问题 更多 >
编程相关推荐