0

I have Dataframe1, which is:

A          B
apple      tree
bed        house
triangle   cheese

And Dataframe 2:

C      D
dog    rabbit
cat    cheese
fish   gold

Is there a way to join them together like the below, without knowing what the columns in Dataframe 2 are, or how many of them there are?

A          B         C       D       
apple      tree      dog     rabbit
bed        house     cat     cheese
triangle   cheese    fish    gold
Bimons
  • 221
  • 2
  • 13
  • Have you done any research? – AMC Jan 18 '20 at 01:39
  • Does this answer your question? [Append column to pandas dataframe](https://stackoverflow.com/questions/20602947/append-column-to-pandas-dataframe) – AMC Jan 18 '20 at 01:39

1 Answers1

1

if they both have the same number of rows you can do

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

A          B         C       D       
apple      tree      dog     rabbit
bed        house     cat     cheese
triangle   cheese    fish    gold
Kenan
  • 13,156
  • 8
  • 43
  • 50