I have a data frame with 40*4. 4 variables are id, trainees, age, and earnings. I want to get average earnings by age and trainees. Trainees is a 0/1 binary variable.
I got ValueError:Buffer has wrong number of dimensions (expected 1, got 2)
The following code runs fine.
a = trainee[trainee['trainees']==1] a['earnings'].mean()
Can anyone help?