Jan-11-2022, 05:35 PM
I couldn't figure out how to do it with list comprehension but here's something that at least does the job.
a = [ { "type": "some.type2", "payload": { "column1": "12345", "column2": "description", "column3": 98 } }, { "type": "some.type2", "payload": { "column1": "12345", "column2": "description", "column3": 180 } }, { "type": "some.type2", "payload": { "column1": "12345", "column2": "description", "column3": "" } } ] z = [] for dictionary in a : for value in dictionary ['payload'].values () : if value == '' : break else : z.append (dictionary) for dictionary in z : print (dictionary)