I need to be able to find an item in a list (an item in this case being a dict) based on some value inside that dict. The structure o
You can create a simple function for this purpose:
lVals = [{'title': 'some value', 'value': 123.4,'id': 'an id'},
{'title': 'another title', 'value': 567.8,'id': 'another id'},
{'title': 'last title', 'value': 901.2, 'id': 'yet another id'}]
def get_by_id(vals, expId): return next(x for x in vals if x['id'] == expId)
get_by_id(lVals, 'an id')
>>> {'value': 123.4, 'title': 'some value', 'id': 'an id'}