ชื่อและตำแหน่งงานของพนักงานที่ได้รับมอบหมายล่าสุดคืออะไร?
What is the name and job title of the staff who was assigned the latest?
df_staff = pd.DataFrame(columns=['staff_name', 'staff_id']); df_staff_department_assignments = pd.DataFrame(columns=['job_title_code', 'staff_id', 'date_assigned_to'])
df_staff[df_staff['staff_id'] == df_staff_department_assignments['staff_id'].astype(str).str[-1]][['staff_name']].join(df_staff_department_assignments.nlargest(1, 'date_assigned_to')['job_title_code'])