I am a beginnering in Python and I don't have an idea how I could perform the following transformation and analysis.
I have a file that looks similar to the following example:
RecordID Comments name value
0 Franco Moro is cool Franco Moro 100
0 Franco Moro is cool Franco Minione 67
1 Jane and Jon Mare Jane Love 63
1 Jane and Jon Mare Jane Franklin 65
1 Jane and Jon Mare Jon McDonagh 71
1 Jane and Jon Mare Jon Mare 100
Now I want to apply the logic that if a name has a value of 100 and there is another record in the same group with a lower score and either the first name or the surname is equal than it should be flagged as OUT. However, if there are many options on the same name but none scores 100 then it should be flagged with a "?".
RecordID Comments name value Flag
0 Franco Moro is cool Franco Moro 100 OK
0 Franco Moro is cool Franco Minione 67 OUT
1 Jane and Jon Mare Jane Love 63 ?
1 Jane and Jon Mare Jane Franklin 65 ?
1 Jane and Jon Mare Jon McDonagh 71 OUT
1 Jane and Jon Mare Jon Mare 100 OK
Can anybody help?
Thanks, Michael