轴向连接
append()是一个实例方法,实现axis=0轴方向的连接,不在axis=1轴方向连接
参数 | 类型 | 说明 |
ignore_index | bool | False 默认值 True 忽略0轴方向的索引,建立新的整数索引( 0,1...n-1 ) |
df1
one two three
a 110 120 130
c 210 220 230
d 310 320 330
df2
one three five
b 11 12 13
c 21 22 23
d 31 32 33
df1.append(df2)
five one three two
a NaN 110 130 120.0
c NaN 210 230 220.0
d NaN 310 330 320.0
b 13.0 11 12 NaN
c 23.0 21 22 NaN
d 33.0 31 32 NaN
df1.append(df2,ignore_index=True)
five one three two
0 NaN 110 130 120.0
1 NaN 210 230 220.0
2 NaN 310 330 320.0
3 13.0 11 12 NaN
4 23.0 21 22 NaN
5 33.0 31 32 NaN