simple.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:luckyhorse 作者: alexmbird 项目源码 文件源码
def _calculate(self, period):
        data = list(self.loadTradesForPeriod(period))
        if len(data) == 0:
            raise InsufficientDataError()
        values      = np.fromiter(map(attrgetter('price'), data), np.float, len(data))
        weights     = np.fromiter(map(attrgetter('volume'), data), np.float, len(data))
        mean, std = weighted_avg_and_std(values, weights)
        return (mean,)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号