i want print, python 'json' list, dictionary Importing mixed data
exam json data
{
"data": [
{
"rows": [
{
"dimensions": [
{
"value": "title1"
}
],
"metrics": [
{
"value": "potato"
},
{
"value": "sweetpotato"
},
{
"conversion_annotation_value": []
},
{
"value": "123123"
}
]
},
]
}
],
}
As far as I know, i use try
itemlist = json.loads(r.text)
for i in itemlist['data']['rows']['dimensions']:
...
for i in itemlist['data']['rows']['metrics']:
...
error, i was see
TypeError: list indices must be integers or slices, not str
i want see, this json data
'title1'
'123123'