I am new to python and trying to work on merging multipe files in a desired layout. One of my problems involve repeating each row of the csv file (excluding header) n number of times. e.g
Initial file:
header1 header2 header3
abc       123    a1
def       456    b1
ghi       789    c1
After modification, the file should look like (e.g 3 repetitions):
header1 header2 header3
abc       123    a1
abc       123    a1
abc       123    a1
def       456    b1
def       456    b1
def       456    b1
ghi       789    c1
ghi       789    c1
ghi       789    c1
What is the best way to do it in python using either csv or pandas. Apologies if the question is too trivial but I am new to such file manipulations using python and didnt find any similar problem on forum.
Thanks,
 
     
     
    