输出增加股票名称

This commit is contained in:
lzybetter
2026-07-10 14:42:51 +08:00
parent 0ae7f38f20
commit 8d6f7430bd
2 changed files with 8 additions and 2 deletions
-2
View File
@@ -31,7 +31,6 @@ def get_history_k(code, start_date='19700101', end_date=None):
stock_code = code + '.' + CN_CODE_TYPE[code[0:2]]
elif code[0:3] in CN_CODE_TYPE:
stock_code = code + '.' + CN_CODE_TYPE[code[0:3]]
print(stock_code)
if stock_code != '':
url = "https://api.zhituapi.com/hs/history/%s/d/f?token=6E0E86BC-15AD-4275-8A95-B02D168D63C1&st=%s"%(stock_code, start_date)
@@ -42,7 +41,6 @@ def get_history_k(code, start_date='19700101', end_date=None):
response = requests.get(url)
data = response.json()
print(data)
df = pd.DataFrame(data)
df['t'] = df['t'].apply(pd.to_datetime)