Witam,
Mam takie oto dane w JSON:
{
"s":1,
"d":{
"bt":2,
"sc":1,
"nav":{ },
"oddsdata":{
"back":{
"E-2-1-0-160.5-0":{
"handicapType":0,
"handicapValue":"160.50",
"isBack":true,
"mixedParameterId":0,
"mixedParameterName":null,
"act":{
"16":true,
"1":false,
"2":false,
"392":false,
"38":false,
"411":false,
"49":false,
"3":false,
"5":false,
"381":false,
"531":false,
"24":false,
"33":false,
"43":false,
"417":true,
"543":false,
"453":true,
"416":false,
"476":false
}
},
"E-2-1-0-158.5-0":{
"handicapType":0,
"handicapValue":"158.50",
"isBack":true,
"mixedParameterId":0,
"mixedParameterName":null,
"act":{
"1":false,
"411":false,
"49":false,
"3":false,
"5":false,
"417":true,
"543":false,
"33":false,
"453":true,
"43":false,
"531":false,
"381":false,
"24":false
}
},
"E-2-1-0-162.5-0":{
"handicapType":0,
"handicapValue":"162.50",
"isBack":true,
"mixedParameterId":0,
"mixedParameterName":null,
"act":{
"1":true,
"411":true,
"49":true,
"3":true,
"5":false,
"24":true,
"33":true,
"43":true,
"417":true,
"543":true,
"453":true,
"531":true,
"381":true,
"416":false,
"476":true,
"2":true,
"392":true,
"38":true,
"16":true
}
}
},
"lay":[ ]
},
"history":{ },
"time-base":1575224898,
"brokenParser":[
"372"
],
"live-stream":{ }
},
"refresh":20
});
Chciałbym otrzymać na końcu informację który, np. E-2-1-0-158.5-0 ma najwięcej pod względem liczbowym stringów "true" w "act".
W tym przypadku widać, że powinien to być E-2-1-0-162.5-0.
Dostałem się do tych True:
for x in json_data['oddsdata']['back'] :
for w in json_data['oddsdata']['back'][str(x)]['act']:
print(json_data['oddsdata']['back'][str(x)]['act'][w])
print("Nastepny")
No i właściwie tutaj mnie przystopowało. Ktoś ma jakieś wskazówki?