Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 395 Bytes

Question_1350.md

File metadata and controls

13 lines (10 loc) · 395 Bytes

LeetCode Records - Question 1350 Students With Invalid Departments

Attempt 1: Use isin()

import pandas as pd

def find_students(departments: pd.DataFrame, students: pd.DataFrame) -> pd.DataFrame:
    return students[~students['department_id'].isin(departments['id'])][['id', 'name']]
  • Runtime: 532 ms (Beats: 99.22%)
  • Memory: 66.56 MB (Beats: 45.14%)