Where can I find mad (mean absolute deviation) in scipy?

前端 未结 10 1602
故里飘歌
故里飘歌 2020-12-23 16:36

It seems scipy once provided a function mad to calculate the mean absolute deviation for a set of numbers:

http://projects.scipy.org/scipy/browser/trunk

10条回答
  •  忘掉有多难
    2020-12-23 17:19

    If you enjoy working in Pandas (like I do), it has a useful function for the mean absolute deviation:

    import pandas as pd
    df = pd.DataFrame()
    df['a'] = [1, 1, 2, 2, 4, 6, 9]
    df['a'].mad()
    

    Output: 2.3673469387755106

提交回复
热议问题