美文网首页
Numpy中的广播

Numpy中的广播

作者: Rooooooooong | 来源:发表于2018-09-30 15:12 被阅读0次

    简单举例便于回忆

    import numpy as np
    matrix = np.random.rand(3,4)
    cal = matrix.sum(axis = 0)
    matrix/cal.reshape(1,4)
    
    >>>
    array([[0.14012578, 0.56554582, 0.20182542, 0.38422263],
           [0.36930785, 0.09705178, 0.19575809, 0.02466836],
           [0.49056637, 0.33740239, 0.60241649, 0.59110901]])
    
    广播思想图.png

    相关文章

      网友评论

          本文标题:Numpy中的广播

          本文链接:https://www.haomeiwen.com/subject/kiswoftx.html