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
Thumbs Up Use generator with sring replacement... [solved] SpongeB0B 9 1,076 Oct-10-2025, 06:43 AM
Last Post: Pedroski55
  If I need to do regex replacement 27000 times, how to shorten it? tatahuft 4 1,490 Dec-26-2024, 01:51 AM
Last Post: deanhystad
  replacement for fpformat.extract GbSig1998 4 1,946 Apr-12-2024, 06:15 PM
Last Post: deanhystad
  String replacement in DB WJSwan 0 1,607 Dec-28-2022, 05:31 AM
Last Post: WJSwan
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 16,612 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
Question Help to find the largest int number in a file directory SalzmannNicholas 1 2,878 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  find 2 largest equal numbers Frankduc 13 7,252 Jan-11-2022, 07:10 PM
Last Post: Frankduc
  Largest product in a grid (projecteuler problem11) tragical 1 3,284 Sep-14-2020, 01:03 PM
Last Post: Gribouillis
  Simple automated SoapAPI Call with single variable replacement from csv asaxty 1 3,312 Jun-30-2020, 06:38 PM
Last Post: asaxty
  frequency of largest number group anshumanmuj 5 4,799 Jun-22-2020, 04:51 PM
Last Post: perfringo

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.