I need to perform below operations:
- iterate over a list of dictionary [{},{}]
- call a transform function which transforms each dictionary, which returns a dictionary.
- Here key and values are not static, but dataframe name and dataframe value. So dictionary may have one ore more key-value pair.
- which I would need to store in a final dictionary
- call a transform function which transforms each dictionary, which returns a dictionary.
Expected : expected data would be a dictionary:
{"key1":"val1", "key2":"val2", "key3":"val3"} # ... in actual, the key would be dataframe name, value would be dataframe value
Simplified Use case:
dictname = [{"key1":"val1","key2":"val2"},{"key3":"value3"}] # input list of dictionary
def transform(each):
return each # to oversimplify, this would be a dictionary with one or more keys with transformations.
final = {transform(each) for each in dictname}
final
went over other related threads on the issue, could not figure out as how to handle the specific case. Could anyone please guide?e