我想找出哪个行号包含最大值。
我尝试过这样的事情:
specimen = loadtxt('dataFile.dat')
stress = specimen[:,3]*(1+(specimen[:,2]/100))
strain = log(1+ specimen[:,2]/100)*100
m = max(stress) #<-- at which row??
print m
print row
答案 0 :(得分:1)
答案 1 :(得分:0)
maxima = [max(row) for row in stress] # Find the max values in each row
m = max(maxima) # Find the absolute max value in the array
for k, rowmax in enumerate(maxima):
if rowmax == m: # Find which row contains the absolute max value
row = k
break
print m
print row