I am working with an object that has multiple keys, each containing a list of equal length:
myobj = {
'key1' : [1, 2, 3],
'key2' : ['a', 'b', 'c'],
'key3' : [true, false, true],
...,
'keyN' : ['length', 'of', 'three'],
}
To achieve my goal, I need to restructure this object into a list of "smaller" objects. Each object in the final list will contain the respective values from each initial list at the same index position. Here's how the transformed object would look based on the example provided:
[
{
'key1' : 1,
'key2' : 'a',
'key3' : true,
...,
'keyN' : 'length'
},
{
'key1' : 2,
'key2' : 'b',
'key3' : false,
...,
'keyN' : 'of'
},
{
'key1' : 3,
'key2' : 'c',
'key3' : true,
...,
'keyN' : 'three'
}
]