I\'m doing a simple if statement in an apply, but depending on the conditional the function could return a series or a dataframe. Interestingly the result I ge
if