关于pandas的concat与append的用法

将原有的数据与新增的数据拼接在一起,是用concat还是append呢?

哪个好,哪个速度快?

下面具体分析:举例子

For Video Recommendation in Deep learning QQ Group 277356808
 
For Visual in deep learning QQ Group 629530787
 
I'm here waiting for you
 

wanna have a date with someone in Beijing please join in the QQ Group 737813700

 如下示例

1-列的名字必须相同才能拼接

>>> xx=np.random.randn(12,4)
			     
>>> xx2=pd.DataFrame(xx,columns=['a','b','c','d'])
			     
>>> xx2
			     
           a         b         c         d
0  -0.002520 -0.263530  0.347520  0.387153
1   1.918575 -0.170964 -0.806263 -0.248214
2  -1.196407  0.720881  0.082972  1.166850
3  -0.579876 -1.180246  1.202263 -1.397498
4   0.576463 -0.578344 -0.689259  0.076412
5   0.226075 -1.318621  0.679772  0.355578
6  -0.779500  0.964879 -0.472901  0.563276
7  -2.295837  1.923033

猜你喜欢

转载自blog.csdn.net/SPESEG/article/details/107316425