Say I have JSON data like so:
{
"friends": {
"Charlie": {
"gender": "female",
"age": "28"
},
"Josh": {
"gender": "male",
"age": "22"
},
"Annie": {
"gender": "female",
"age": "24"
}
}
}
What's the best/most pythonic way to "query" all my friend's age?
I understand that I can drill into a specific dataset by calling:
var_holding_json['friends']['Josh']['age']
But I can't grasp how I can go from this to
- "get all my friends' age".
- "get all my friends' names whose age is > 22"
Thanks for any pointer!