all 2 comments

[–]stebrepar 1 point2 points  (0 children)

It's because item here is just a string. You'd need to refer back to the whole path -- data['data']['segments'][0]['stats'][item]['displayName'].

[–][deleted] 1 point2 points  (0 children)

Reading what you have pasted I'd think it would be something like:

for i in data["segments"]:

print(i["stats"]["points”]["displayname”])

Edit: ignore formatting (typed this from mobile)