I am trying to do my previous pandas code
df["SC_3"] = df[subset_columns].apply(lambda row: (row.value_counts() >= 3).any(), axis=1)