FunctionRacerProblemsRace

Patients With a Condition

EasypandasPython

patients has columns id and conditions, where conditions is text with codes separated by single spaces (possibly empty). Return the ids of patients with at least one code that starts with "DIAB1", in row order.

Example 1

patients {"id":[1,2],"conditions":["ACNE DIAB100","XDIAB1 FLU"]}
returns [1]

Code DIAB100 starts with DIAB1; XDIAB1 does not.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems