Consider a list of tuples such as:
a = [(1,2), (3,4)]
I often find myself trying to unzip list like these into separate lists for each column value e.g.:
b,c = list(zip(*a))
In this case, b will be a list containing values 1 and 3.
I often find my self wanting b and c to be numpy arrays an not lists.
In this case what I usually do is:
b,c = list(zip(*a))
b = np.array(b)
c = np.array(c)
The last two lines look cumbersome.
Is there any way to unzip a list directly into two numpy arrays without casting them directly through numpy.array?
Thank you