array-of-dict

Finding minimum value in an array of dicts

Finding minimum value in an array of dicts Question: I have an array like the following: people = [{‘node’: ‘john’, ‘dist’: 3}, {‘node’: ‘mary’, ‘dist’: 5}, {‘node’: ‘alex’, ‘dist’: 4}] I want to compute the minimum of all the ‘dist’ keys. For instance, in the above example, the answer would be 3. I wrote the …

Total answers: 4