0

Two data frames of different lengths:

df1:                               df2:
Column1  Column2  Column3          Column1  Column2
Url      Name      Description     Type 1   Duration 1
                                   Type 2   Duration 2
                                   Type 3   Duration 3
                                   Type 4   Duration 4

How to get such a table?

Column1  Column2  Column3          Column4  Column5

Url1      Name1     Description1   Type *   Duration 1
                                   Type 2   Duration 2
                                   Type 3   Duration 3
                                   Type 4   Duration 4

I want to write data to Excel table. An example of the required table

Tried:

df1.merge (df2, left_index = True, right_index = True)
df2.join (df2)

As a result, only one line from df2 is written

Klikovskiy
  • 5
  • 1
  • 3
  • Welcome to Stackoverflow. Please take the time to read this post on [how to provide a great pandas example](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) as well as how to provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) and revise your question accordingly. These tips on [how to ask a good question](http://stackoverflow.com/help/how-to-ask) may also be useful. – jezrael Oct 11 '21 at 07:27
  • Solution - pd.concat([df1, df2], axis=1) – Klikovskiy Oct 11 '21 at 07:32

0 Answers0