how do I compute a weighted moving average using pandas

Using pandas I can compute

  • simple moving average SMA using pandas.stats.moments.rolling_mean
  • exponential moving average EMA using pandas.stats.moments.ewma
  • But how do I compute a weighted moving average (WMA) as described in wikipedia http://en.wikipedia.org/wiki/Exponential_smoothing ... using pandas?

    Is there a pandas function to compute a WMA?


    No, there is no implementation of that exact algorithm. Created a GitHub issue about it here:

    https://github.com/pydata/pandas/issues/886

    I'd be happy to take a pull request for this-- implementation should be straightforward Cython coding and can be integrated into pandas.stats.moments

    链接地址: http://www.djcxy.com/p/58096.html

    上一篇: Hbase:如何指定Hbase主机的主机名

    下一篇: 我如何使用熊猫来计算加权移动平均数