title: Pandas: Assign MultiIndex Column from DataFrame
body: <p>I have a DataFrame with multiIndex columns. Suppose it is this:</p>
  
  <pre><code>index = pd.MultiIndex.from_tuples([('one', 'a'), ('one', 'b'),
                                     ('two', 'a'), ('two', 'b')])
  df = pd.DataFrame({'col': np.arange(1.0, 5.0)}, index=index)
  
  df = df.unstack(1)
  </code></pre>
  
  <p>(I know this definition could be more direct). I now want to set a new level 0 column based on a DataFrame. For example</p>
  
  <pre><code>df['col2'] = df['col'].applymap(lambda x: int(x &lt; 3))
  </code></pre>
  
  <p>This does not work. The only method I have found so far is to add each column seperately:
  <a href="https://stackoverflow.com/questions/16088741/pandas-add-a-column-to-a-multiindex-column-dataframe">Pandas: add a column to a multiindex column dataframe</a>
  , or some sort of convoluted joining process.</p>
  
  <p>The desired result is a new level 0 column <code>'col2'</code> with two level 1 subcolumns: <code>'a'</code> and <code>'b'</code></p>
  
  <p>Any help would be much appreciated, Thank you.</p>