Plot or reshape 2D array matplotlib
<p>i have no idea how can i plot scatter with a 2D array of this type:</p>

<pre><code>a=[[x0,t0],[x1,t1],...,[xn,tn]]
</code></pre>

<p>the plot should be x vs t, maybe instead of doing this with a maplotlib routine be able to reshape a to obtain:</p>

<pre><code>a=[[x0,x1,...,xn],[t0,t1,...,tn]]
</code></pre>

<p>thanks!</p>

<p>You can use <code>numpy.transpose</code>:</p>

<pre><code>import numpy as np
a=[["x0","t0"],["x1","t1"],["xn","tn"]]

np.transpose(a)
# array([['x0', 'x1', 'xn'],
#        ['t0', 't1', 'tn']], 
#       dtype='&lt;U2')
</code></pre>

python numpy matplotlib