Using Django, Python, Pandas and TA-lib, this code works: df = pd.readcsv('curData.csv')…
- User
Using Django, Python, Pandas and TA-lib, this code works: df = pd.read_csv('curData.csv') return JsonResponse({"result":True,'data':df.values.tolist(),'columns':df.columns.tolist()})
But this code dosn't work: df = pd.read_csv('curData.csv') df['RSI'] = ta.RSI(df['close'],14) return JsonResponse({"result":True,'data':df.values.tolist(),'columns':df.columns.tolist()}) Assistant
The code you provided is not working because it is trying to use the TA-Lib library to calculate the RSI (Relative Strength Index) on the close price of the data, but the TA-Lib library is not imported or installed on the system. To use the TA-Lib library in your code, you need to first install it using pip by running the following command in your terminal or command prompt:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.