DataFrame合并数据df.append

import pandas as pd
from pandas import DataFrame

df1 = DataFrame([[1.4,2],[7.1,-4.5],
                [2,3],[0.75,-1.3]],
               columns=['one','two'])
print(df1)
df2 = DataFrame([[1.4,2],[7.1,-4.5],
                [2,3],[0.75,-1.3]],
               columns=['one','two'])
print(df2)

df3 = df1.append(df2).reset_index(drop=True)
print(df3)


 

one two
0 1.40 2.0
1 7.10 -4.5
2 2.00 3.0
3 0.75 -1.3
one two
0 1.40 2.0
1 7.10 -4.5
2 2.00 3.0
3 0.75 -1.3
one two
0 1.40 2.0
1 7.10 -4.5
2 2.00 3.0
3 0.75 -1.3
4 1.40 2.0
5 7.10 -4.5
6 2.00 3.0
7 0.75 -1.3

 

posted @ 2021-02-22 20:29  OTAKU_nicole  阅读(488)  评论(0编辑  收藏  举报