Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 496 Bytes

1527. Patients With a Condition.md

File metadata and controls

17 lines (15 loc) · 496 Bytes

1527. Patients With a Condition

Question Link

Pandas Solution

import pandas as pd

def find_patients(patients: pd.DataFrame) -> pd.DataFrame:
    result=patients[patients['conditions'].str.contains(r'\bDIAB1')]
    return result

SQL Solution

# Write your MySQL query statement below
select patient_id, patient_name, conditions from Patients
where conditions like 'DIAB1%' or conditions like '% DIAB1%'