我想打印出具有最大值的数组的索引(并且由于索引从 0 开始,我需要将索引值加 1 以获得 1 索引)。例子:
rslt = np.amax(final_array)
print("The maximum value is :", rslt)
print("The optimal choice that has that value is :", rslt.index[])
上下文:我正在用 Python 编写一些多标准决策分析代码。我导入 numpy 来处理备选方案、标准和权重的数组。我使用 np.amax 在最终数组中找到最大值。