Build Dictionary in Python Loop – List and Dictionary Comprehensions
The short form is as follows (called dict comprehension, as analogy to the list comprehension, set comprehension etc.): x = { row.SITE_NAME : row.LOOKUP_TABLE for row in cursor } so in general given some _container with some kind of elements and a function _value which for a given element returns the value that you want …