root mean square in numpy and complications of matrix and arrays of numpy

后端 未结 6 739
猫巷女王i
猫巷女王i 2021-02-07 05:38

Can anyone direct me to the section of numpy manual where i can get functions to accomplish root mean square calculations ... (i know this can be accomplished using np.mean and

6条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 05:43

    I use this for RMS, all using NumPy, and let it also have an optional axis similar to other NumPy functions:

    import numpy as np   
    rms = lambda V, axis=None: np.sqrt(np.mean(np.square(V), axis))
    

提交回复
热议问题