久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      python如何求列表平均值?

      python如何求列表平均值?

      推薦教程:《python視頻教程》

      python如何求列表平均值?

      python函數(shù)求列表平均值的方法:

      用法:mean(matrix,axis=0)其中matrix為一個矩陣,axis為參數(shù)

      以m * n矩陣舉例:

      axis不設(shè)置值,對 m*n 個數(shù)求均值,返回一個實數(shù)

      axis=0:壓縮行,對各列求均值,返回 1* n 矩陣

      axis=1:壓縮列,對各行求均值,返回 m *1 矩陣

      >>>  import numpy as np >>> num1 = np.array([[1,2,3],[2,3,4],[3,4,5],[4,5,6]]) >>> now2 = np.mat(num1) >>> now2 matrix([[1, 2, 3],         [2, 3, 4],         [3, 4, 5],         [4, 5, 6]]) >>> np.mean(now2) # 對所有元素求均值 3.5 >>> np.mean(now2,0) # 壓縮行,對各列求均值 matrix([[ 2.5,  3.5,  4.5]]) >>> np.mean(now2,1) # 壓縮列,對各行求均值 matrix([[ 2.],         [ 3.],         [ 4.],         [ 5.]])

      推薦相關(guān)文章:《python教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號