Run
import pandas as pd df1 = pd.DataFrame({'A': ['A0', 'A1', 'A2', 'A3'], 'B': ['B0', 'B1', 'B2', 'B3'], 'C': ['C0', 'C1', 'C2', 'C3'], 'D': ['D0', 'D1', 'D2', 'D3']}, index=[0, 1, 2, 3]) df2 = pd.DataFrame({'B': ['B2', 'B3', 'B4', 'B5'], 'D': ['D2', 'D3', 'D4', 'D5'], 'F': ['F2', 'F3', 'F4', 'F5']}, index=[2, 3, 4, 5]) df3 = pd.DataFrame({'D': ['D3', 'D4', 'D5'], 'G': ['G3', 'G4', 'G5']}, index=[3, 4, 5]) result = pd.concat([df1, df2, df3], axis=1, join='inner') print(result)
Output