# -*- 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)

结果:

Python使用np.c_和np.r_实现数组转换成矩阵

 

相关文章:

  • 2022-12-23
  • 2021-12-06
  • 2023-03-20
  • 2022-01-19
  • 2022-12-23
  • 2022-01-23
  • 2021-07-25
猜你喜欢
  • 2021-09-24
  • 2021-09-30
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-05-17
相关资源
相似解决方案