This is my data frame that should be repeated for 5 times:
>>> x = pd.DataFrame({'a':1,'b':2},index = range(1))
>>> x
a b
0 1 2
I wanna have the result like this:
>>> x.append(x).append(x).append(x)
a b
0 1 2
0 1 2
0 1 2
0 1 2
But there must be a way smarter than keep appending.. Actually the data frame Im working on should be repeated for 50 times..
I haven't found anything practical, including those like np.repeat
---- it just doesnt work on data frame.
Could anyone help?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…