stack data horizontally pandas

Solutions on MaxInterview for stack data horizontally pandas by the best coders in the world

showing results for - "stack data horizontally pandas"
Joann
13 May 2018
1import pandas as pd
2
3df1 = pd.DataFrame({
4    'A': [1,2,3,4,5],
5    'B': [1,2,3,4,5]
6})
7
8df2 = pd.DataFrame({
9    'C': [1,2,3,4,5],
10    'D': [1,2,3,4,5]
11})
12
13df_concat = pd.concat([df1, df2], axis=1)
14
15print(df_concat)