This is the list i am dealing with. Value:
[[0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.94, 0.0, 0.0, 0.63, 0.0],
[0.51, 0.51],
[0.54, 0.54, 0.0, 0.0,0.63, 0.0, 0.51, 0.54, 0.51, 1.0, 0.51],
[0.81,0.05, 0.13, 0.7, 0.02]]
I have tried to find the highest value belongs to which list. Here the highest value is 1 and its in third list. ie, index 2. How to get this?
maxval=[]
maxval1=[]
for i in range(0,len(Value)):
maxval1.append(max(Value[i]))
maxval.append(max(maxval1))
maxval1
Out[220]: [0.94, 0.51, 1.0, 0.81]
maxval
Out[221]: [1.0]
index=[]
index1=[]
for i in range(0,len(Value)):
index1.append(Value[i].index(maxval))
gives error: ValueError: [1.0] is not in list