condition_list = [df.A > 80, df.A > 40] result_list = ["Class A", "Class B"] ## corresponding conditions and result should align in the two lists. np.select(condition_list, result_list, "Class C") ## Run-time: 2.4 s
Hosted onDeepnote