python—机器学习合并数据
import numpy as npa = np.arange(6).reshape(2,3)b = np.random.randint(10,20,size=(4,3))#concatenate(array_list,axis=0/1) 沿着指定axis进行数组合并 0为行,1为列,默认为0#np.vstack或者np.row_stack(array_list)按照行合并#np.hstack或者np.column_stack(array_list) 按照列合并c=np.concatenate([a,b])d=np.vstack([a,b])e=np.row_stack([a,b])m= np.arange(6).reshape(3,2)n= np.random.randint(10,20,size=(3,2))p= np.hstack([m,n])q= np.column_stack([m,n])print(p)
相关推荐
mmmjyjy 2020-07-16
jzlixiao 2020-05-04
babycrying 2009-12-11
zhangxiaojiakele 2020-01-07
lybbb 2019-12-25
newfarhui 2019-12-12
jiahaohappy 2019-12-04
BETTINA 2019-12-02
jianghuchuanke 2019-11-03
morexyoung 2019-11-01
Selier 2014-05-28
javaer 2016-12-06
kx0 2019-04-29
xiajlxiajl 2015-09-01
xiajlxiajl 2013-01-25
82580194 2015-06-13
Junzizhiai 2012-01-13