I have this sample json data in a list:
data = [
{ "Name": "John_Doe", "Age" : 25 }
{ "Name": "Jane_Roe", "Age" : 26 }
]
I need a way to extract the all the key value pairs from an element in the list based on the 'Name' Key. If my variable = 'John_Doe', then the script should only return the values related to John_Doe, i, e only the following values :
{ "Name": "John_Doe", "Age" : 25 }
[x for x in data if x["Name"]=="John_Doe"]?