zip arrays inside dictionary understanding:
d = {x: list(*i) for x, i in zip(*a, (b, c))}
or alternatively:
d = {x: [y, z] for x, (y, z) in zip(*a, (*b, *c))}
or if you like deep unpacking scripts:
d = {x: [y, z] for x, ((y, z),) in zip(*a, (b, c))}
There are quite a few packaging / unpacking combinations to choose from. All this, of course, produces the same conclusion with the dictionary d , which now:
{'x': ['x1', 'y1'], 'y': ['x2', 'y2']}
source share