I have a data frame looking like this:
classid grade haveTeacher
0 99 1
1 40 1
1 50 0
1 70 1
2 50 0
3 34 0
I'd like to find out what I could write in pandas to find out the standard deviation of "grade" across classid that have a teacher (1 means there is a teacher). I know we would have to groupby "classid", but I was wondering what would go inside the .apply and lambda function to fulfill all these conditionals?