Skip to content

Commit

Permalink
change response format of json
Browse files Browse the repository at this point in the history
  • Loading branch information
megymj committed Nov 12, 2023
1 parent f5b1209 commit 25cbe17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ def recommend_stock():
tendency = data.get('tendency')
#Request body - tendency <LION - 공격투자형 , SNAKE - 적극투자형, MONKEY - 위험중립형, SHEEP - 안정추구형>

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()
Expand Down Expand Up @@ -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})

Expand Down

0 comments on commit 25cbe17

Please sign in to comment.