Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mode(days_diffs).mode[0]报错 #6

Open
BCAA50000 opened this issue Feb 2, 2024 · 2 comments
Open

mode(days_diffs).mode[0]报错 #6

BCAA50000 opened this issue Feb 2, 2024 · 2 comments

Comments

@BCAA50000
Copy link

alphalens.utils - > get_clean_factor_and_forward_returns -> compute_forward_returns 的 mode(days_diffs).mode[0]一直报错。
检查了很多遍输入的数据格式factor和price都是复合规范的,不知道问题出在哪。

请问作者你这边遇到过类似的情况么?

@newboy518
Copy link

from scipy.stats import mode

data = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]
result = mode(data)
print(result.mode) # 4
print(result.count) # 4

应该改成:mode(days_diffs).mode

@liangcaihua
Copy link

changed to mode([days_diffs]).mode can also 真 无语

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants