title: Convert a list into 2-D array in python
body: <p>I am trying to create a plot and the points are shaded with a colorbar. </p>
  
  <pre><code>matplotlib.pyplot.scatter(x,y, c=time_color)
  </code></pre>
  
  <p>I have a time_color list, e.g.</p>
  
  <pre><code>time_color = [0, 4, 3, 3, 2, 3, 5, 4, 0, 3, 3, 2, 1, 2, 3, 4, 5, 1, 4, 3, 2]
  </code></pre>
  
  <p>Unfortunately, the plot command will not accept a list to specify color. So I converted it to an array</p>
  
  <pre><code>numpy.array(time_color)
  </code></pre>
  
  <p>This gave me a one dimensional array.</p>
  
  <pre><code>numpy.ndim(numpy.array(time_color))
  </code></pre>
  
  <p>How can I convert a list into a 2 dimensional array to produce a 3-D plot (the third dimension being color)?</p>
  
  <p>Thank you.</p>