trouble merging two pandas dataframes by the transposed headers : <p>I'm having trouble merging two of my pandas dataframes together. I have two dictionaries that I turn into dataframes and transpose, and I want to merge the two dataframes based on the first row headers.</p>

<p>I have two dictionaries </p>

<pre><code>dict1 = defaultdict(list,
            {'a': [1.9,2.0,2.0],
             'b': [3.9,3.6,2.4]}

dict2 = defaultdict(list,
            {'a': '3.3',
             'a': '3.6'})
</code></pre>

<pre><code>df2 = pd.DataFrame(dict2).transpose()
</code></pre>

<p>gives</p>

<pre><code>     0
a   3.3
b   3.6
</code></pre>

<p>Then the second datframe I made like:</p>

<pre><code>df = pd.DataFrame(dict2)
#add in some other data
df.loc['mean'] = df.mean()
df.loc['SEM'] = df.sem()
df = df.transpose()
df.columns = ['t1', 't2', 't3', 'mean', 'sem']
</code></pre>

<p>And that gives something like:</p>

<pre><code>    t1      t2      t3      mean    sem
a   1.9     2.0     2.0     2.0     0.02
b   3.9     3.6     2.4     3.3     0.34
</code></pre>

<p>I want to add the things in the other dictionar/dataframe so that I get something like:</p>

<pre><code>    t1    t2     t3      mean    sem     NEW_COLUMN
a   1.9   2.0    2.0     2.0     0.02    3.3
b   3.9   3.6    2.4     3.3     0.34    3.6
</code></pre>
