Merging multiple dataframes on column
<p>I am trying to merge/join multiple <code>Dataframe</code>s and so far I have no luck. I've found <code>merge</code> method, but it works only with two Dataframes. I also found this SO <a href="https://stackoverflow.com/a/23671390/1080517">answer</a> suggesting to do something like that:</p>

<pre><code>df1.merge(df2,on='name').merge(df3,on='name')
</code></pre>

<p>Unfortunatelly it will not work in my case, because I have 20+ number of dataframes. </p>

<p>My next idea was to use <code>join</code>. According to the reference when joining multiple dataframes I need to use list and only I can join on index column. So I changed indexes for all of the columns (ok, it can be done grammatically easily) and end up with something like this:</p>

<pre><code>df.join([df1,df2,df3])
</code></pre>

<p>Unfortunately, also this approach failed, because other columns names are this same in all dataframes. I've decided to do the last thing, that is renaming all columns. But when I finally joined everything:
df = pd.Dataframe()
df.join([df1,df2,df3])</p>

<p>I've received empty dataframe. I have no more idea, how I can join them. Can someone suggest anything more?</p>

<p><strong>EDIT1:</strong></p>

<p>Sample input:</p>

<pre><code>import pandas as pd

df1 = pd.DataFrame(np.array([
    ['a', 5, 19],
    ['b', 14, 16],
    ['c', 4, 9]]),
    columns=['name', 'attr1', 'attr2'])
df2 = pd.DataFrame(np.array([
    ['a', 15, 49],
    ['b', 4, 36],
    ['c', 14, 9]]),
    columns=['name', 'attr1', 'attr2'])

df1 
  name attr1 attr2
0    a     5    19
1    b    14    16
2    c     4     9

df2
  name attr1 attr2
0    a    15    49
1    b     4    36
2    c    14     9
</code></pre>

<p>Expected output:</p>

<pre><code>df
  name attr1_1 attr2_1 attr1_2 attr2_2
0    a     5    19      15      49
1    b    14    16      4       36
2    c     4     9      14      9
</code></pre>

<p>Indexes might be unordered between dataframes, but it is guaranteed, that they will exists.</p>