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

ROPE error #315

Open
ShuaiGe57 opened this issue Feb 19, 2024 · 0 comments
Open

ROPE error #315

ShuaiGe57 opened this issue Feb 19, 2024 · 0 comments

Comments

@ShuaiGe57
Copy link

ShuaiGe57 commented Feb 19, 2024

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() will occur if there are same likes.
key parameter of sorted should be set in line #74 of rope.py

    def get_best_runs(self, likes, pars, runs, percentage):
        """
        Returns the best xx% of the runs"""
        return [
            new_pars
            for (new_likes, new_pars) in sorted(zip(likes, pars), key=lambda x: x[0])[
                int(len(likes) * (1 - percentage)) :
            ]
        ]
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

1 participant