I have the following two lists:
lista = ['a', 'b']
listb = ['c', 'd']
And I want the output list like this:
res = [['a', 'c'], ['b', 'd']]
My solution is
arr = np.array([lista, listb]).T
res = arr.tolist()
Is there a simpler way to do it?
>Solution :
[list(a) for a in zip(lista, listb)]
Whether this is simplier might be subjective, but it is one of the options for sure.