Aug-20-2020, 04:48 PM
am trying to pass two columns from two different dataframes, is there any way i can do it. I tried .apply however it will help me to pass two columns of same dataframe.
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.
(Aug-20-2020, 04:48 PM)Rejoice Wrote: [ -> ]am trying to pass two columns from two different dataframes, is there any way i can do it. I tried .apply however it will help me to pass two columns of same dataframe.
while True: df1 = int(float(input("Enter the opening of DOW Jones markets: "))) df2 = int(float(input("Enter the closing of DOW Jones markets: "))) OPEN = [0,0,df1] CLOSE = [0,0,df2] if (sum(OPEN))>(sum(CLOSE)): print((sum(OPEN))-(sum(CLOSE)), 'OPENING') print(('BEARISH')) elif (sum(OPEN))<(sum(CLOSE)): print((sum(OPEN))+(sum(CLOSE)), 'CLOSING') print(('BULLISH')) else: print('Dow Jones Unchanged')