import pandas as pd
Let\'s say I have a dataframe like so:
dataframe
df = pd.DataFrame({\"a\":range(4),\"b\":range(1,5)})
Almost there. Use zip* to unpack the function. Try this:
def divideAndMultiply(x,y): return x/y, x*y df["e"], df["f"] = zip(*df.a.apply(lambda val: divideAndMultiply(val,2)))