# -*- coding: utf-8 -*-
“””
Created on Sat Jun 30 14:49:22 2018
@author: zhen
“””
import numpy as np
a = np.array([[1,2,3],[11,22,33]])
b = np.array([[4,5,6],[44,55,66]])
# 数组连接成矩阵
c = np.c_[a,b]
r = np.r_[a,b]
print(‘————-按行转换成矩阵—————–‘)
print(c)
print(‘————-按列转换成矩阵—————–‘)
print(r)
结果:
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/industrynews/13001.html