diff --git a/lib/seattleflu/id3c/cli/command/clinical.py b/lib/seattleflu/id3c/cli/command/clinical.py index 43079c12..34f2eca6 100644 --- a/lib/seattleflu/id3c/cli/command/clinical.py +++ b/lib/seattleflu/id3c/cli/command/clinical.py @@ -1107,11 +1107,7 @@ def column_set_is_binary(df: pd.DataFrame, prefix:str) -> bool: otherwise returns False. """ cols = [c for c in df.columns if c.startswith(prefix)] - for c in cols: - if not np.isin(df[c].dropna().unique(), [0, 1]).all(): - return False - - return True + return all([np.isin(df[c].dropna().unique(), [0, 1]).all() for c in cols]) def map_icd10_codes(df: pd.DataFrame, sample_stream: str) -> pd.DataFrame: