I have a function foo() which takes two arguments as two columns of pandas named year and month and return a list of four numbers.
df['A'],df['B'],df['C'],df['D']= df.apply(lambda x: foo(x.year, x.month), axis=1,result_type="expand")
It just gives me four columns named A,B,C,D with 0,1,2,3 respectively filled in them. What am I doing wrong?
Kindly don't answer for single variable outputs or single variable arguments. There are plenty of examples out there for that. Thankyou so much for the help.