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)) :
]
]
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