박하늘

stockdata.py : clarify code

import FinanceDataReader as fdr
import numpy as np
import pandas as pd
def basicinform(input):
stocks = pd.read_csv('stockcodename.csv',index_col=0)
stocks = pd.read_csv('stockcodename.csv', index_col=0)
symbol = ''
for i in enumerate(stocks.Name) :
for i in enumerate(stocks.Name):
if i[1] == input:
symbol = (stocks.iloc[i[0]].Symbol)
break
......@@ -16,8 +16,9 @@ def basicinform(input):
price = df.Close.iloc[-1]
ror = ror_df[-1]
value = {"현재가": price ,
"거래랑": volume ,
"전일 대비 수익률:" : ror
value = {
"현재가": price,
"거래랑": volume,
"전일 대비 수익률:": ror
}
return value
return value
......