Strolling through the Review Queues I come across a suggested edit for this answer: https://stackoverflow.com/a/50831430/1870795
The suggested edit is by an anonymous user
and adds a code variation that was posted as comment by a user who did not post the original answer.
Original answer:
How about something along the lines:
com_vals = df['Home_team_scores'].unique() df['full_scores_list'].apply(lamda v: v in com_vals)
The suggested edit adds:
Improved according to comments:
Instead of the lambda-function, you can use a helper function for the apply():
com_vals = df['Home_team_scores'].unique() def helper(): return v in com_vals df['full_scores_list'].apply(helper)
You can more fine-grainded controll the outputs and conditions in the helper() function. I do not quite understand the in and outputs that you have, so this is all I can currently provide. be a little more detailed with an example dataframe and expected output
The edit is based on the original answer and reads as if it was a statement by the original answerer, e.g. I do not quite understand...
.
Now I wonder:
- Should the edit be approved considering that the suggested edit speaks in the answerers' name by using the first person
I...
? - Should the subjective part be re-edited into a general statement without using the first person?
- Could the anonymous user even be the original answerer?
I do not understand
/all I can currently provide
. These are statements about personal ability and knowledge of the answerer by a person who is not the answerer. That looks strange.helper
function is only a minor cosmetic improvement, with no difference in functionality to the original code.