5.4矩阵和随机数

2021-03-17  本文已影响0人  云殊_Tech
  1. np.matrix

    • matrix(string/list/tuple/array/np.ndarray)
    • mat(string/list/tuple/array/np.ndarray)
  2. 矩阵对象的属性

    • ndim 矩阵的维数
    • shape 矩阵的形状
    • size 矩阵的元素个数
    • dtype 元素的数据类型
  3. matrix multiplication
    A * B

  4. transpose, inverse
    .T
    .I

  5. np.random


    • 只有np.random.randint()返回int,其余的均返回float
  6. np.random.shuffle(list/ndarray) 洗牌函数

    • 打乱数组元素的顺序
    • 对于多维数组,shuffle() 只打乱第一维元素
上一篇 下一篇

猜你喜欢

热点阅读