ค้นหาจำนวนนักศึกษาและจำนวนอาจารย์รวมของแต่ละแผนก
Find the total number of students and total number of instructors for each department.
df_department = pd.DataFrame(columns=['dept_name']); df_student = pd.DataFrame(columns=['id', 'dept_name']); df_instructor = pd.DataFrame(columns=['dept_name', 'id'])
pd.concat([df_student.groupby('dept_name').size(), df_instructor.groupby('dept_name').size()], axis=1).reset_index().rename(columns={'dept_name': '', 0 : 'Instructors', 1 : 'Students'})