From db16b9281c9493e5f19d7183e7e21c5845b7d8ed Mon Sep 17 00:00:00 2001 From: ak_quant Date: Thu, 24 Mar 2022 14:34:21 +0800 Subject: [PATCH] fix(stock_us_hist): fix stock_us_hist interface fix stock_us_hist interface --- akshare/__init__.py | 3 ++- akshare/stock_feature/stock_hist_em.py | 5 +++-- docs/changelog.md | 6 ++++++ docs/introduction.md | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/akshare/__init__.py b/akshare/__init__.py index c5edc40ac15..bd68c987faf 100644 --- a/akshare/__init__.py +++ b/akshare/__init__.py @@ -1909,9 +1909,10 @@ 1.4.86 fix: fix rename all interface in fund_aum_em.py 1.4.87 add: add fund_portfolio_industry_allocation_em interface 1.4.88 fix: fix fund_new_found_em interface +1.4.89 fix: fix stock_us_hist interface """ -__version__ = "1.4.88" +__version__ = "1.4.89" __author__ = "AKFamily" import sys diff --git a/akshare/stock_feature/stock_hist_em.py b/akshare/stock_feature/stock_hist_em.py index aaa1976bf7a..c1129a5ceff 100644 --- a/akshare/stock_feature/stock_hist_em.py +++ b/akshare/stock_feature/stock_hist_em.py @@ -914,7 +914,7 @@ def stock_us_spot_em() -> pd.DataFrame: def stock_us_hist( - symbol: str = "105.APCX", + symbol: str = "105.MSFT", period: str = "daily", start_date: str = "19700101", end_date: str = "22220101", @@ -923,7 +923,7 @@ def stock_us_hist( """ 东方财富网-行情-美股-每日行情 http://quote.eastmoney.com/us/ENTX.html#fullScreenChart - :param symbol: 股票代码; 此股票代码需要通过调用 ak.stock_us_spot_em 的 `代码` 字段获取 + :param symbol: 股票代码; 此股票代码需要通过调用 ak.stock_us_spot_em() 的 `代码` 字段获取 :type symbol: str :param period: choice of {'daily', 'weekly', 'monthly'} :type period: str @@ -981,6 +981,7 @@ def stock_us_hist( temp_df['涨跌幅'] = pd.to_numeric(temp_df['涨跌幅']) temp_df['涨跌额'] = pd.to_numeric(temp_df['涨跌额']) temp_df['换手率'] = pd.to_numeric(temp_df['换手率']) + temp_df.sort_values(['日期'], inplace=True) return temp_df diff --git a/docs/changelog.md b/docs/changelog.md index 3ae5312b61a..3f8bed5a32e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,6 +11,10 @@ ## 更新说明 +1.4.89 fix: fix stock_us_hist interface + + 1. 修复 stock_us_hist 接口,结果数据根据日期排序 + 1.4.88 fix: fix fund_new_found_em interface 1. 修复 fund_em_new_found 接口命名为 fund_new_found_em 接口 @@ -209,6 +213,8 @@ ## 版本更新说明 +1.4.89 fix: fix stock_us_hist interface + 1.4.88 fix: fix fund_new_found_em interface 1.4.87 add: add fund_portfolio_industry_allocation_em interface diff --git a/docs/introduction.md b/docs/introduction.md index 6b8c57e3f1e..aee3051e854 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -5,7 +5,7 @@ **风险提示:[AKShare](https://github.com/akfamily/akshare) 开源财经数据接口库所采集的数据皆来自公开的数据源,不涉及任何个人隐私数据和非公开数据。 同时本项目提供的数据接口及相关数据仅用于学术研究,任何个人、机构及团体使用本项目的数据接口及相关数据请注意商业风险。** -1. 本文档更新时间: **2022-03-23**; +1. 本文档更新时间: **2022-03-24**; 2. 如有 [AKShare](https://github.com/akfamily/akshare) 库、文档及数据的相关问题,请在 [AKShare Issues](https://github.com/akfamily/akshare/issues) 中提 Issues; 3. 欢迎关注 **数据科学实战** 微信公众号:
4. **知识星球【数据科学家】** 已上线,想了解更多金融量化、数据科学相关的内容,欢迎加入 **知识星球【数据科学家】** 高质量社区,里面有丰富的视频、问答、文章、书籍及代码等内容: