Jav
Jav

Reputation: 35

How to concatenate two DataFrame by repeating a row?

I have a two DataFrame and I need repeat Cars as many times as questions and export it to .csv DataFrame_1:

Opinion    
 Cars   
 Cars
 Cars
 Cars
 Cars
 Cars
 Cars
 Cars

And DataFrame_2

  Questions
   Like Cars
   Model
   Years
   color

Final DataFrame

  Opinion   Questions
    Cars      Like Cars
    Cars      Model
    Cars      Years
    Cars      Color

Any panda function that allows this to be done?

Upvotes: 1

Views: 35

Answers (1)

Yuca
Yuca

Reputation: 6091

Try

DataFrame_2['Opinion'] = 'Cars'

Upvotes: 2

Related Questions