From 25cbe1779240288b0bb728f4632e138a09771a08 Mon Sep 17 00:00:00 2001 From: Moojun Date: Sun, 12 Nov 2023 22:46:09 +0900 Subject: [PATCH] change response format of json --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 8ed7b34..fbe951a 100644 --- a/app.py +++ b/app.py @@ -1099,7 +1099,7 @@ def recommend_stock(): tendency = data.get('tendency') #Request body - tendency - df = pd.read_csv("AI-RoboAdvisor-Flask/stock_data.csv", encoding='cp949') + df = pd.read_csv("stock_data.csv", encoding='cp949') selected_features = ['PER', 'PBR', 'ROE', 'ROA', '외국인비율', '매출액증가율'] scaler = StandardScaler() @@ -1134,7 +1134,7 @@ def recommend_stock(): recommended_stocks = [] for i,score in random_selected_stocks: stock_name = df['종목명'][i] - recommended_stocks.append({"stock_name": stock_name}) + recommended_stocks.append(stock_name) return jsonify({"tendency": tendency, "recommended_stocks": recommended_stocks})