Combine two Pandas dataframes with the same index

pandas, python

Solution

pandas.concat([df1, df2], axis=1)

Problem

I have two dataframes with the same index but different columns. How do I combine them into one with the same index but containing all the columns? I have: ``` A 1 10 2 11 B 1 20 2 21 ``` and I need the following output: ``` A B 1 10 20 2 11 21 ```

Original source

Related problems