Reformat table in Python
<p>I have a table in a Python script with numpy in the following shape:</p>

<pre><code>[array([[a1, b1, c1], ..., [x1, y1, z1]]), 
 array([a2, b2, c2, ..., x2, y2, z2])
]
</code></pre>

<p>I would like to reshape it to a format like this:</p>

<pre><code>(array([[a2],
        [b2],
         .
         .
         .
        [z2]],
        dtype = ...),
 array([[a1],
        [b1],
         .
         .
         .
        [z1]])
)
</code></pre>

<p>To be honest, I'm also quite confused about the different parentheses. array1, array2] is a list of arrays, right? What is (array1, array2), then?</p>

<pre><code> #[array1,array2] is a python list of two numpy tables(narray)
 #(array1,array2) is a python tuple of two numpy tables(narray)
 tuple([array.reshape((-1,1)) for array in your_list.reverse()])
</code></pre>

python numpy