qlib icon indicating copy to clipboard operation
qlib copied to clipboard

fix loc error in double_ensemble sample_reweight()

Open matchyc opened this issue 3 years ago • 4 comments

I think that's a "[] loc error" in double_ensemble sample_reweight() function. Fixed it with slightly changing the index in brackets: i_b -> b

matchyc avatar Jun 14 '22 06:06 matchyc

Oh... Didn't change anything except the line described above cause the build failed. Some errors are caused by the network. Could you give any Suggestions? @you-n-g

matchyc avatar Jun 14 '22 11:06 matchyc

@symphony233

I think the changed code equals the previous version. I test the ensure that they are the same with the following code.

import pandas  as pd

s = pd.Series({"a": 1, "b": 2})

for i_b, b in enumerate(s.index):
    assert s[b] == s[i_b]

Did I miss anything?

you-n-g avatar Jun 14 '22 14:06 you-n-g

@symphony233

I think the changed code equals the previous version. I test the ensure that they are the same with the following code.

import pandas  as pd

s = pd.Series({"a": 1, "b": 2})

for i_b, b in enumerate(s.index):
    assert s[b] == s[i_b]

Did I miss anything?

I will go back to verify what I proposed before, sorry for bothering you.

matchyc avatar Jun 14 '22 14:06 matchyc

@symphony233 I think the changed code equals the previous version. I test the ensure that they are the same with the following code.

import pandas  as pd

s = pd.Series({"a": 1, "b": 2})

for i_b, b in enumerate(s.index):
    assert s[b] == s[i_b]

Did I miss anything?

I will go back to verify what I proposed before, sorry for bothering you.

We don't like the word 'bother' :D. Feel free to open any discussion in the community :)

you-n-g avatar Jun 15 '22 02:06 you-n-g

This PR is stale because it has been open for a year with no activity. Remove the stale label or comment on the PR otherwise this will be closed in 5 days

github-actions[bot] avatar Feb 08 '23 15:02 github-actions[bot]