Concatenate nested python lists column-wise (similar to numpy.hstack() )
<p>I am trying to concatenate two nested lists column-wise in Python. This is similar to numpy.hstack() but is in base Python with Python lists. I am able to do this in the following way. Is there a better, potentially faster way of concatenating nested lists column-wise?</p>

<pre><code>list_a = [[2, 2], [4, 4], [6, 6]]
list_b = [[1, 1], [3, 3], [5, 5]]

# list_b as array-like
#[2, 2]
#[4, 4]
#[6, 6]

# list_c as array_like
#[1, 1]
#[3, 3]
#[5, 5]

for x,y in zip(list_a,list_b):
    x = x + y

# list_a after concatenation
#[2, 2, 1, 1]
#[4, 4, 3, 3]
#[6, 6, 5, 5]
</code></pre>

<p>List comprehension might not be faster, but it is cleaner.</p>

<pre><code>[a + b for a,b in zip(list_a,list_b)]
</code></pre>

<p>or</p>

<pre><code>[a.extend(b) for a,b in zip(list_a,list_b)]
</code></pre>

python list