Trying to parse a defaultdict(list)
Input:
defaultdict(class <'list'>,{'key1': ['v1', 'v2'], 'key2': [v3, v4], 'key3': ['v5', 'v6']})
desired output:
list_dic = [{key1: v1, key2: v3, key3: v5}, {key1: v2, key2: v4, key3: v6}]
Has to work for n values in the lists.
Following from the desired output, I intend to use mysql executemany to insert these values into a db. If anyone has any better suggestions of how I could insert a deafaultdict(list) into a table in mysql - I'd appreciate it.