I have a pandas.DataFrame
as follows:
df1 =
a b
0 1 2
1 3 4
I'd like to make this three times to become:
df2 =
a b
0 1 2
0 1 2
0 1 2
1 3 4
1 3 4
1 3 4
df2
is made from a loop, but it is not efficient.
How can I get df2
from df1
using a matrix way which is faster?