简述
比如这两个数据:
a:
a=pd.Series([1, 2, 3,], index=[2, 3, 4])
输出效果为:
2 1
3 2
4 3
dtype: int64
对应的b:
b=pd.Series([4, 1, 2, 3,], index=[1, 2, 3, 4])
1 4
2 1
3 2
4 3
dtype: int64
合并:
c = pd.concat([a, b], join='outer', axis=1)
c.columns = ['a', 'b']
c
a b
1 NaN 4
2 1.0 1
3 2.0 2
4 3.0 3
同样的道理,换成DataFrame是一样的。