Spaces:
Sleeping
Sleeping
| def matched_super_generic(row, | |
| generic_data, | |
| colname, | |
| super_colname, | |
| match_col): | |
| """_summary_ | |
| Args: | |
| row (_type_): _description_ | |
| generic_data (_type_): _description_ | |
| colname (_type_): _description_ | |
| super_colname (_type_): _description_ | |
| match_col (_type_): _description_ | |
| Returns: | |
| _type_: _description_ | |
| """ | |
| diag = row[colname] | |
| match_ = generic_data[generic_data[super_colname] == diag] | |
| if not match_.empty: | |
| row[match_col] = match_[super_colname].iloc[0] | |
| return row |