I have a dictionary of an unknown amount of keys, and I'm trying to get the products of all the keys combined, while still retaining which list the items came from. For example
dicts = {
"d1": ["d1_value", "d1_value2"],
"d2": ["d2_value", "d2_value2"]
}
I am trying to get the product of the two lists, but their origin key retained.
result = [
{
"d1": "d1_value",
"d2": "d2_value"
},
{
"d1": "d1_value",
"d2": "d2_value2"
},
{
"d1": "d1_value2",
"d2": "d2_value"
},
{
"d1": "d1_value2",
"d2": "d2_value2"
}
]
Anyone have any ideas?