I have data that is in 3 columns (name, question, response) that resulted from judging a student research symposium. There are 2 possible choices for level (graduate/undergraduate), and 5 for college (science, education, etc.)
What I need to do is take the average of the numerical responses for a given name, and sort by average numerical score for that person to output a table containing:
College Level Rank science graduate 1st science graduate 2nd science graduate 3rd science undergrad 1st ... education graduate 1st ... education undergrad 3rd
Here's a sample data table:
name question response Smith, John Q1 10 Smith, John Q2 7 Smith, John Q3 10 Smith, John Q4 8 Smith, John Q5 10 Smith, John Q8 8 Smith, John level graduate Smith, John colleg science Smith, John Q9 4 Jones, Mary Q3 10 Jones, Mary Q2 10 Jones, Mary Q1 10 Jones, Mary Q4 10 Jones, Mary level undergraduate Jones, Mary college education Jones, Mary Q6 10 Jones, Mary Q7 10 Jones, Mary Q9 10
A talented student did this for us in excel using pivot tables, but I'm sure this can be done using pandas, and I'm very curious how to do it (I'm quite new to pandas). The tricky part is all the 'useful' information is in that 3rd column.