引用https://blog.csdn.net/zenghaitao0128/article/details/78512715

  1. reshape用法:
    一般用法:numpy.arange(n).reshape(a,b)依次生成n个随机数,并且以a行b列的数组形式显示:
    matplotlib中的reshape()和squeeze()
    特殊用法:mat(or array).reshape(c,-1)必须是矩阵形式或者数组形式才能使用。表示将此矩阵或者数组重组,以c行d列的形式表示(-1的作用就在于自动计算d:d=数组或者矩阵里的所有元素的个数/c,d 必须是整数,否则报错)
    reshape(-1,e)即列数固定为e,行数自动计算。
    matplotlib中的reshape()和squeeze()
    2.squeeze用法
    matplotlib中的reshape()和squeeze()
    matplotlib中的reshape()和squeeze()
    matplotlib中的reshape()和squeeze()画图结果
    matplotlib中的reshape()和squeeze()

相关文章: