def split(arr, cond): return [arr[cond], arr[~cond]] data_true, data_false = split(data_x, data_y == 1)