Python Forum

Full Version: Extract the largest value from a group without replacement (beginner)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a dataframe that represents different combinations of people (11 people in total), with a score per combination ranging from 0 (bad) to 20 (very good):

nom_combinaison; personnes; score_combinaison_sur_20
combi1           personne1  18
combi1           personne2  18
combi2           personne2  4
combi2           personne3  4
combi3           personne1  14
combi3           personne3  14
...       ; ...
I would like to find a way to extract the combinations that have the best score while being careful not to take the same person several times. I have tried several methods with research on the internet, unfortunately without results. Is it possible to do this?

Thank you.
So we understand this, what would be the correct result
for the 6 lines you are showing ?

Paul