Pandas Easiest Solution
\n\n# Approach\nThe regular expression pattern r\'\bDIAB1\' means:\n\n\b: Match a word boundary.\nDIAB1: Match the string "DIAB1".\n\nThis pattern will match ro
\n\n# Approach\nThe regular expression pattern **r\'\\bDIAB1\'** means:\n\n\\b: Match a word boundary.\nDIAB1: Match the string "DIAB1".\n\nThis pattern will match rows where the \'conditions\' column contains the word "DIAB1" as a whole word.\n\n# Code\n```\nimport pandas as pd\n\ndef find_patients(patients: pd.DataFrame) -> pd.DataFrame:\n    result = patients[patients[\'conditions\'].str.contains(r\'\\bDIAB1\')]\n    return result\n```
['Pandas']