I have a dataframe with two columns: hash and results.
The hash column contains the task ID, it can be repeated several times.
The result column contains the user’s answer to this task. The answers contain specific string values like: “Yes”, “No”, “Perhaps”, 404″
My task is to calculate the consistency of user answers.
For example, if 3 users answered the same way to a task with one hash, then the consistency is 100%. If 2 out of 3 answered the same way, then 66.6. If one of 3, then 33.3%. If everyone answered differently, then 0.
I tried to calculate the maximum number of repeated answer values for each hash via “duplicated”, but this does not work when there are no repeated values.
Please tell me what functions can be used to solve this problem.
Dmitry is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.