I want calculate RSI indicator value for multiple column in Pandas DataFrame. I am looking for a method to avoid loop, here is the code I am using:
rsi_calculations = pd.DataFrame() for column in rsi_trans.columns: rsi = ta.RSI(rsi_trans[column].values, timeperiod=30) rsi_calculations[column] = rsi
In the above code I am calculating RSI value and appending it to pandas data frame, but its taking more time.
Is there a more efficient way to do this?
I've imported TA-Lib as
ta and used its
RSI function to calculate RSI value.