find a minimum value in an array of floats

后端 未结 4 857
攒了一身酷
攒了一身酷 2020-12-30 20:07

how would one go about finding the minimum value in an array of 100 floats in python? I have tried minindex=darr.argmin() and print darr[minindex]

4条回答
  •  渐次进展
    2020-12-30 20:58

    You need to iterate the 2d array in order to get the min value of each row, then you have to push any gotten min value to another array and finally you need to get the min value of the array where each min row value was pushed

    def get_min_value(self, table):
        min_values = []
        for i in range(0, len(table)):
            min_value = min(table[i])
            min_values.append(min_value)
    
        return min(min_values)
    

提交回复
热议问题