title: How to merge a Series and DataFrame
body: <blockquote>
    <p>If you came here looking for information on <em>how to
    merge a <code>DataFrame</code> and <code>Series</code> on the index</em>, please look at <a href="https://stackoverflow.com/a/40762674/4909087">this
    answer</a>.</p>
    
    <p>The OP's original intention was to ask <em>how to assign series elements
    as columns to another DataFrame</em>. If you are interested in knowing the
    answer to this, look at the <a href="https://stackoverflow.com/a/26266031/4909087">accepted answer</a> by EdChum.</p>
  </blockquote>
  
  <hr>
  
  <p>Best I can come up with is</p>
  
  <pre><code>df = pd.DataFrame({'a':[1, 2], 'b':[3, 4]})  # see EDIT below
  s = pd.Series({'s1':5, 's2':6})
  
  for name in s.index:
      df[name] = s[name]
  
     a  b  s1  s2
  0  1  3   5   6
  1  2  4   5   6
  </code></pre>
  
  <p>Can anybody suggest better syntax / faster method? </p>
  
  <p>My attempts:</p>
  
  <pre><code>df.merge(s)
  AttributeError: 'Series' object has no attribute 'columns'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>df.join(s)
  ValueError: Other Series must have a name
  </code></pre>
  
  <p><em>EDIT</em> The first two answers posted highlighted a problem with my question, so please use the following to construct <code>df</code>:</p>
  
  <pre><code>df = pd.DataFrame({'a':[np.nan, 2, 3], 'b':[4, 5, 6]}, index=[3, 5, 6])
  </code></pre>
  
  <p>with the final result</p>
  
  <pre><code>    a  b  s1  s2
  3 NaN  4   5   6
  5   2  5   5   6
  6   3  6   5   6
  </code></pre>