试图在数组中找到所有相等的最小值然后检索索引时出现真值错误

Truth error while trying to find all equal minimum values in array, then retrieve indices

我正在尝试查找数组中的所有最小值并检索它们的索引。

import numpy as np
a = np.array([[1,2],[1,4]])
minE = np.min(a)
ax,ay = np.unravel_index(minE, a.shape)

仅returnsminE = 1ax, ay = 0 1

任何人都可以帮助我提供所有等值最小值的索引(这里是两个 1 的索引)吗?

你在找这个吗:

x = np.array([[1,2,3],[1,4,2]])
np.where(x == np.amin(x))