def fun_ndarray():
a = [[1,2,7],
[-6,-2,-3],
[-4,-8,-55]
]
b = [3,5,6]
a = np.array(a)
b = np.array(b)
a_b_column = np.column_stack((a,b))#左右根据列拼接
a_b_row = np.row_stack((a,b))#上下按照行拼接
print('a_b_column')
print(a_b_column)
print('a_b_row')
print(a_b_row)
result:
note:
column_stack, row_stack function parameter is a tuple
np.delete(): delete a row or column
data = np.delete(data,3,axis=1) # 删除第四列
Undertake programming in Matlab, Python and C++, machine learning, computer vision theory implementation and guidance, both undergraduate and master's degree, salted fish trading, professional answers please go to know, please contact QQ number 757160542 for details, if you are the one.