Join "colums" of list of lists into "rows" of list of lists
<p>Suppose I have several lists of length n:</p>

<pre><code>a = [1, 2, 3]
b = [4, 5, 6]
c = [7, 8, 9]
d = [-1, -2, -3]
</code></pre>

<p>I put those lists into a list:</p>

<pre><code>x = [a, b, c]
</code></pre>

<p>Now I'd like to end up with the following list:</p>

<pre><code>y = [[1, 4, 7, -1], [2, 5, 8, -2], [3, 6, 9, -3]]
</code></pre>

<p>What is a quick and pythonic way to do so? (To get from <code>x</code> to <code>y</code>.)</p>

<p>The entries could be anything, I use numbers just because they visualize good.</p>

<p>You can do it in one line of code:</p>

<pre><code>[[z[i] for z in x] for i in range(len(x[0]))]
</code></pre>

<p>What it does is that to iterate over all indexes (<code>i</code>) and then iterate over all lists in <code>x</code> (<code>z</code>) and create a new list.</p>

python