ค้นหา ID และนามสกุลครูที่ถูกกักขังมากที่สุด พร้อมรหัสประเภทกักขัง “AFTER”?
Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"?
df_detention = pd.DataFrame(columns=['teacher_id', 'detention_type_code']); df_teachers = pd.DataFrame(columns=['last_name', 'teacher_id'])
df_detention[df_detention['detention_type_code'] == 'AFTER']['teacher_id'].value_counts().idxmax(); df_teachers[df_teachers['teacher_id'] == df_detention[df_detention['detention_type_code'] == 'AFTER']['teacher_id'].value_counts().idxmax()]['last_name']