title: Create 2D lists in python with variable length indexed vectors
body: <p>I am working on an image processing problem where I have code that looks like this (the code written below just illustrates the type of problem I want to solve):</p>
  
  <pre><code>for i in range(0,10):
    for j in range(0,10):
      number_length = round(random.random()*10)
      a = np.zeros(number_length)
      Z[i][j] = a
  </code></pre>
  
  <p>What I want to do is create some sort of 2D list or np.array (not really sure) where I essentially index a term for every pixel in an image, and have a vector/list of values for every individual pixel of which I can not anticipate its length, moreover, the length of each vector for every indexed pixel is different to each other. What is the best way to go about this?</p>
  
  <p>In my MATLAB code the workaround is simple: I define a 2D cell and just assign any vector to any element in the 2D cell. Since cells do not complain about coherent length of every indexed vector, this is a good thing. What is the equivalent optimal solution to handle this in python?</p>
  
  <p>Ideally the solution should <em>not</em> involve anticipating the maximum length of "a" for any pixel and to make all indexed vectors the same length (since this implies I have to do some sort of zero padding that will consume memory if the indexed vectors are high dimensional and these high dimensional vectors are sparse through out the image).</p>