简体   繁体   中英

Joining/merging multiple dataframes

I have 4 dataframe objects with 1 row and X columns that I would want to join, here's a screenshot of them:

I would want them to become one big row.

Thanks for anybody who helps!

You could use concatenate in dataframe as below,

df1 = pd.DataFrame(columns=list('ABC'))
df1.loc[0] = [1,1.23,'Hello']

df2 = pd.DataFrame(columns=list('DEF'))
df2.loc[0] = [2,2.23,'Hello1']

df3 = pd.DataFrame(columns=list('GHI'))
df3.loc[0] = [3,3.23,'Hello3']

df4 = pd.DataFrame(columns=list('JKL'))
df4.loc[0] = [4,4.23,'Hello4']

pd.concat([df1,df2,df3,df4],axis=1)

样本

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM