To describe the problem with a small example input and desired output:
a = ['a', 'b', 'c']
b = [1, 2, 3]
c = expr
print(c)
>> [['a', 1], ['b', 2], ['c', 3]]
So I have come to a question about how to nicely perform this in a pythonic way.
What I have come up with is a list comprehension that does this nicely using zip, however it does feel like a bit of a cop-out using zip in the following manner:
[[x, y] for x, y in zip(a,b)]
Is there another way?
Furthermore, since zip is not a solution for the general case with
Edit: As Dani Mesejo pointed out, Pythons zip built-in can take m lists of length n, that one wants to combine in the same way.m iterables.
I'm mostly interested of nice plain python solutions.
I know that numpy can do this through nice nparray concatenations :)
Thanks!