title: Appending a numpy array to a multiindex dataframe
body: <p>I have some trouble populating a pandas <code>DataFrame</code>. I am following the instructions found <a href="https://pandas.pydata.org/pandas-docs/stable/advanced.html" rel="nofollow noreferrer">here</a> to produce a <code>MultiIndex</code> <code>DataFrame</code>. The example work fine except that I want to have an array instead of a single value.</p>
  
  <pre><code>activity = 'Open_Truck'
  id = 1
  index = pd.MultiIndex.from_tuples([(activity, id)], names=['activity', 'id'])
  v = pd.Series(np.random.randn(1, 5), index=index)
  </code></pre>
  
  <blockquote>
    <p>Exception: Data must be 1-dimensional</p>
  </blockquote>
  
  <p>If I replace <code>randn(1, 5)</code> with <code>randn(1)</code> it works fine. For <code>randn(1, 1)</code> I should use <code>randn(1, 1).flatten('F')</code> but also works.
  When trying:</p>
  
  <pre><code>v = pd.Series(np.random.randn(1, 5).flatten('F'), index=index)
  </code></pre>
  
  <blockquote>
    <p>ValueError: Wrong number of items passed 5, placement implies 1</p>
  </blockquote>
  
  <p>My intention is to add 1 feature vector (they are <code>np.array</code> of course in real case scenario and not <code>np.random.randn</code>) for each <code>activity</code> and <code>id</code> in each row.<br>
  So, How do I manage to add an array in a <code>MultiIndex</code> <code>DataFrame</code>?</p>
  
  <p>Edit:<br>
  As I am new to pandas I mixed <code>Series</code> with <code>DataFrame</code>. I can achieve the above using <code>DataFrame</code> which is two-dimensional by default:</p>
  
  <pre><code>arrays = [np.array(['Open_Truck']*2),
              np.array(['1', '2'])]
  df = pd.DataFrame(np.random.randn(2, 4), index=arrays)
  df
                 0         1         2         3
  Open 1 -0.210923  0.184874 -0.060210  0.301924
       2  0.773249  0.175522 -0.408625 -0.331581
  </code></pre>