Skip to content

WMA计算错误 #1993

@wfh1300

Description

@wfh1300

ops计算代码中的下面这个函数不对。应该使用np.nansum(w*x)
def weighted_mean(x):
w = np.arange(len(x)) + 1
w = w / w.sum()
return np.nanmean(w * x)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions