I have a function
def return_true_false(a,b,c):
'''
returns true if stuff, else returns false
'''
I then apply this function to a Dataframe twice to split the dataframe on the result
df_True = df[df.apply(lambda x: return_true_false(x[a],x[b],x[c]),axis=1)]
df_false = df[df.apply(lambda x: not return_true_false(x[a],x[b],x[c]),axis=1)]
However, this does the calculation twice on each row. My question is, is there a way to split this dataset on a function and only go through the dataset once?