- spac.phenotyping.combine_phenotypes(data_df, phenotype_columns, multiple=True)[source]
Combine multiple binary phenotype columns into a new column in a vectorized manner.
- Parameters:
data_df (pandas.DataFrame) – DataFrame containing the phenotype columns.
phenotype_columns (list of str) – List of binary phenotype column names.
multiple (bool, optional) – Whether to concatenate the names of multiple positive phenotypes. If False, all multiple positive phenotypes are labeled as “no_label”. Default is True.
- Returns:
A Series representing the combined phenotype for each row.
- Return type:
pandas.Series