def R1(df): if df['OPEN']>df['CLOSE']: return "BEARISH" elif df['OPEN']<df['CLOSE']: return "BULLISH" day1['type analysis'] = df.apply(R1,axis=1)the above code is what i trying to achieve.
when the columns ['OPEN'] & ['CLOSE'] are in the same dataframe (df) i could pass it to the function as a whole dataframe and inside the function i can take necessary column and do the calculations. I was trying to figure out if there is a means to pass the only desired columns from two different dataframes into the function.
df.apply helps me to pass the whole dataframe, likewise can i pass two columns of two different dataframe (df1 & df2) to the function, and store the returned value to another dataframe (df3)