title: Is numpy optimized to work on array of arrays?
body: <p>Some answers on stackoverflow suggest to use a ndarray of ndarray, when working with data in which the number of elements per row is not constant (<a href="https://stackoverflow.com/questions/3386259/how-to-make-a-multidimension-numpy-array-with-a-varying-row-size">How to make a multidimension numpy array with a varying row size?</a>).</p>
  <p>Is numpy optimized to work on a structure like that (array of arrays, also called nested arrays) ?</p>
  <p>Here's a simplified example of such a structure:</p>
  <pre><code>import numpy as np
  x = np.array([1,2,3])
  y = np.array([4,5])
  data = np.array([x,y],dtype=object)
  </code></pre>
  <p>It's possible to do operations like:</p>
  <pre><code>print(data+1)
  print(data+data)
  </code></pre>
  <p>But some operations would fail like :</p>
  <pre><code>print(np.sum(data))
  </code></pre>
  <p>What's happening behind the scenes with this type of structure ?</p>