title: Matrices with different row lengths in numpy
body: <p>Is there a way of defining a matrix (say <em>m</em>) in numpy with rows of different lengths, but such that <em>m</em> stays 2-dimensional (i.e. m.ndim = 2)?</p>
  
  <p>For example, if you define <em>m = numpy.array([[1,2,3], [4,5]])</em>, then <em>m.ndim</em> = 1. I understand why this happens, but I'm interested if there is any way to trick numpy into viewing <em>m</em> as 2D. One idea would be padding with a dummy value so that rows become equally sized, but I have lots of such matrices and it would take up too much space. The reason why I really need <em>m</em> to be 2D is that I am working with Theano, and the tensor which will be given the value of <em>m</em> expects a 2D value.</p>