Hello colleagues, could you help me write algorithm for my task.I need to solve the problem using python to data processing. Namely: i have got data of test (in .txt file) The subjects answered on 14 tasks , they did it 5 timesThe subjects are separated by a blank line.for example1,0,0,1,0,1,0,1,1,1,0,1,1,11,0,1,1,0,0,1,1,0,1,0,1,1,11,0,0,1,0,1,0,1,1,0,0,1,0,11,0,0,0,1,1,1,1,0,1,1,0,1,00,1,0,1,1,1,0,1,1,0,0,1,1,0

0,0,0,0,1,0,0,1,0,0,0,0,0,10,0,0,1,0,0,1,1,0,0,0,1,1,11,1,1,1,0,0,1,1,0,1,1,1,0,11,1,0,1,0,1,1,1,0,0,0,1,0,00,0,0,1,0,1,1,1,1,0,1,1,1,019 subjects respectively each of subject has this series 14 task 5 times

1- task done right0-task done wrongIn other words, each subject done 70 tasks. where 1- task done right , and 0-task done wrongIf you add up all correctly solved tasks and divide by 70, you get the probability that subject will decide right following test.Please Tell me how to write code to calculate the probability of error for each of the subjects and to print these probability to the screenthank you

synthex wrote:In other words, each subject done 70 tasks. where 1- task done right , and 0-task done wrongIf you add up all correctly solved tasks and divide by 70, you get the probability that subject will decide right following test.

Not really. They have done 14 tasks, each of them five times; this is different than them doing 70 different task. The performance of a subject is unlikely to be uniform across the tasks. For example, if you look at subject 17 (third from the bottom), they excelled at the first three tasks (preforming perfectly for the first two and getting the third one wrong only once), but not task 10 (didn't get it right once). Your proposed metric will be very inaccurate for determining the probability that a particular subject does a particular task correctly; and it will only be a decent predictor of the subject's overall performance on the next test, if the next test's overall task distribution is similar to the one you have data for.

As for helping with implementing the calculation, first post the attempt you've made on your own.

In the future, please copy an paste the (complete) error message and traceback into your post, rather than attaching a screenshot (or even worse, linking to one hosted on some random site).

You don't need to do the whole "if __name__ == '__main__'" thing when you're in the interactive shell. Also you're calling something called main() without defining it. Finally, when opening a file, you need to specify the path to the file as a string, not file.