I created a function with if statement to know which table to query and return a value to my dataframe, but I am getting truth value of series is ambiguous error.
Function if statement is as follows:
Any help is appreciated.
Function if statement is as follows:
if s == "A": table = "mytable" elseif s == "Z": table = "othertable"I am creating new column and applying like:
df['newcol'] = df.apply(myfunc(df[col1],df[col2]), axis=1)I have also tried
axis = 0
.Any help is appreciated.