From ea245f543516dc600d711d5ac8886431ba09b139 Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Fri, 10 May 2024 11:04:59 +0800 Subject: [PATCH] Fix issue 1729 (#1776) * fix issue 1729 * fix issue 1729 * fix issue 1729 --------- Co-authored-by: Linlang Lv (iSoftStone Information) --- scripts/data_collector/cn_index/collector.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/data_collector/cn_index/collector.py b/scripts/data_collector/cn_index/collector.py index 96f68ef9cd..237df6fe87 100644 --- a/scripts/data_collector/cn_index/collector.py +++ b/scripts/data_collector/cn_index/collector.py @@ -396,14 +396,7 @@ def get_history_companies(self) -> pd.DataFrame: today = pd.Timestamp.now() date_range = pd.DataFrame(pd.date_range(start="2007-01-15", end=today, freq="7D"))[0].dt.date ret_list = [] - col = ["date", "symbol", "code_name"] for date in tqdm(date_range, desc="Download CSI500"): - rs = bs.query_zz500_stocks(date=str(date)) - zz500_stocks = [] - while (rs.error_code == "0") & rs.next(): - zz500_stocks.append(rs.get_row_data()) - result = pd.DataFrame(zz500_stocks, columns=col) - result["symbol"] = result["symbol"].apply(lambda x: x.replace(".", "").upper()) result = self.get_data_from_baostock(date) ret_list.append(result[["date", "symbol"]]) bs.logout()