Python Forum
Extract the largest value from a group without replacement (beginner)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract the largest value from a group without replacement (beginner)
#1
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.
Reply
#2
So we understand this, what would be the correct result
for the 6 lines you are showing ?

Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  String replacement in DB WJSwan 0 713 Dec-28-2022, 05:31 AM
Last Post: WJSwan
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 5,977 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
Question Help to find the largest int number in a file directory SalzmannNicholas 1 1,588 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  find 2 largest equal numbers Frankduc 13 3,443 Jan-11-2022, 07:10 PM
Last Post: Frankduc
  Largest product in a grid (projecteuler problem11) tragical 1 2,243 Sep-14-2020, 01:03 PM
Last Post: Gribouillis
  Simple automated SoapAPI Call with single variable replacement from csv asaxty 1 2,058 Jun-30-2020, 06:38 PM
Last Post: asaxty
  frequency of largest number group anshumanmuj 5 2,922 Jun-22-2020, 04:51 PM
Last Post: perfringo
  Sort by the largest number of the same results (frequency) inlovewiththedj 3 2,145 Apr-01-2020, 07:29 AM
Last Post: DPaul
  extract specific data from a group of json-files ledgreve 3 3,238 Dec-05-2019, 07:57 PM
Last Post: ndc85430
  line replacement help mdalireza 8 3,357 Nov-11-2019, 12:54 PM
Last Post: mdalireza

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020