{ "cells": [ { "cell_type": "code", "execution_count": 69, "id": "a98e649f-c649-437c-8b43-8f4b17660524", "metadata": {}, "outputs": [], "source": [ "import sqlalchemy as sa\n", "engine = sa.create_engine(\n", " 'mssql+pyodbc://sa:passw0rd!@192.168.1.7/master?driver=ODBC+Driver+18+for+SQL+Server',\n", " connect_args = {\n", " \"TrustServerCertificate\": \"yes\"\n", " }, echo=False)" ] }, { "cell_type": "code", "execution_count": 8, "id": "7d0a8dc0-4a98-4766-b0f7-6b2bf61e8514", "metadata": {}, "outputs": [], "source": [ "with engine.connect() as conn:\n", " rs = conn.execute(\"select SecID from [IndexInfo].[dbo].[Constituents] group by SecID\")\n", " stock_list = [stock_id for (stock_id,) in rs.fetchall()]\n", " \n", " rs = conn.execute(\"select IndexID from [IndexInfo].[dbo].[Constituents] group by IndexID\")\n", " index_list = [index_id for (index_id,) in rs.fetchall()]\n" ] }, { "cell_type": "code", "execution_count": 112, "id": "cb3235f9-7719-4e94-9a8f-65cd535a2a5e", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "with engine.connect() as conn:\n", " rs = conn.execute(\"\"\"\n", " select \n", " SecID, \n", " CONCAT(SUBSTRING(EnterDate, 1, 4), '-', SUBSTRING(EnterDate, 5, 2), '-', SUBSTRING(EnterDate, 7, 2)) AS EnterDate, \n", " CONCAT(SUBSTRING(ExitDate, 1, 4), '-', SUBSTRING(ExitDate, 5, 2), '-', SUBSTRING(ExitDate, 7, 2)) AS ExitDate\n", " FROM (SELECT\n", " SecID, \n", " CAST(EnterDate AS varchar) AS EnterDate,\n", " CAST(IIF(ExitDate=0, 20220630, ExitDate) AS varchar) AS ExitDate \n", " from [IndexInfo].[dbo].[Constituents] where IndexID='SH000852'\n", " )t\n", " \"\"\")\n", " index_info = rs.fetchall()\n", "\n", "index_info = pd.DataFrame(index_info)\n", "index_info\n", "index_info.to_csv('csi1000.txt', sep='\\t', columns=['SecID', 'EnterDate', 'ExitDate'], index=False, header=False)" ] }, { "cell_type": "code", "execution_count": null, "id": "bc14e8be-a360-4a49-88fb-a9763d8ba655", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "\n", "def make_date(series):\n", " # 特别是对于分红表,如果某些关键日期还未公布,则会填充0,导致日期解析失败\n", " series.loc[series == 0] = np.nan\n", " return pd.to_datetime(\n", " series.astype(str), format='%Y%m%d')\n", "\n", "\n", "with engine.connect() as conn:\n", " rs = conn.execute(\"select SecID from [IndexInfo].[dbo].[Constituents] group by SecID\")\n", " stock_list = [stock_id for (stock_id,) in rs.fetchall()]\n", "\n", " rs = conn.execute(\"select IndexID from [IndexInfo].[dbo].[Constituents] group by IndexID\")\n", " concept_list = [index_id for (index_id,) in rs.fetchall()]\n", " \n", " stat = \"select distinct S_INFO_WINDCODE, TRADE_DT from Level2BytesKline.dbo.KLine\"\n", " rs = conn.execute(stat)\n", " stock_date_list = [(stock_name, date) for stock_name, date in rs.fetchall()]\n", " df_calendar = pd.DataFrame(stock_date_list, columns=['code', 'm_nDate'])\n", " df_calendar['m_nDate'] = make_date(df_calendar['m_nDate'])\n", "\n" ] }, { "cell_type": "code", "execution_count": 78, "id": "5bc376b2-1e59-4d4d-a630-37c99884b2d5", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "\n", "def tscode_to_windcode(series):\n", " return series.apply(lambda x : x[2:] + '.' + x[:2])\n", "\n", "\n", "def _make_stock2concept_onehot():\n", " # 从calendar中截取出与当前stock有关的日期,然后设置成index\n", " # 此处calendar使用的是海通高频数据构建,因此股票代码为WIND-CODE\n", " for wind_code, df_calendar_stock in df_calendar.groupby('code'):\n", " ts_code = wind_code[-2:] + wind_code[:-3]\n", " \n", " df_calendar_stock.set_index(['code', 'm_nDate'], inplace=True)\n", "\n", " # 纵表转横表,`concept_list`作为列名\n", " df_stock2concept = pd.DataFrame(0, index=df_calendar_stock.index, columns=concept_list)\n", "\n", " # 从Sql-Server中读取`stock_id`所对应的概念板块进出日期\n", " # 此数据是从天软指数数据中提取,因此需要使用TSCODE\n", " with engine.connect() as conn:\n", " code = \"\"\"\n", " select \n", " SecId, IndexID, EnterDate, ExitDate \n", " from \n", " [IndexInfo].[dbo].[Constituents] \n", " where \n", " SecID='{stock_id}'\n", " \"\"\".format(\n", " stock_id = ts_code\n", " )\n", " print(code)\n", " rs = conn.execute(code)\n", " row_list = rs.fetchall()\n", "\n", " for (stock_id, concept_id, start_date, end_date) in row_list:\n", " _mark_stock2concept_onehot(df_stock2concept[concept_id], concept_id, start_date, end_date)\n", "\n", " yield df_stock2concept\n", "\n", "\n", "def _mark_stock2concept_onehot(df_stock2concept, concept_id, start_date, end_date):\n", " # 个股成为某个概念(指数)的起始日期是必定会提供的\n", " # 但是截止日期可能缺失,确实一般意味着当前仍然是在此概念板块中\n", " # 因此会通过将日期填充至最后一日来表示当前仍然在此概念板块内\n", " if end_date is None or end_date == 0:\n", " start_date = pd.to_datetime(str(start_date), format='%Y%m%d')\n", " df_stock2concept.loc[df_stock2concept.index.get_level_values('m_nDate') >= start_date] = 1\n", " else:\n", " start_date = pd.to_datetime(str(start_date), format='%Y%m%d')\n", " end_date = pd.to_datetime(str(end_date), format='%Y%m%d')\n", " df_stock2concept.loc[\n", " (df_stock2concept.index.get_level_values('m_nDate') >= start_date) & \n", " (df_stock2concept.index.get_level_values('m_nDate') <= end_date)\n", " ] = 1" ] }, { "cell_type": "code", "execution_count": 79, "id": "a67786e5-4776-4492-8a87-72defe93eda4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " select \n", " SecId, IndexID, EnterDate, ExitDate \n", " from \n", " [IndexInfo].[dbo].[Constituents] \n", " where \n", " SecID='SZ000001'\n", " \n", "('SZ000001', 'SH000940', 20090925, 0)\n", "('SZ000001', 'SZ399619', 20110615, 0)\n", "('SZ000001', 'SH000980', 20110510, 0)\n", "('SZ000001', 'SZ399387', 20111202, 0)\n", "('SZ000001', 'SZ399920', 20100129, 20180611)\n", "('SZ000001', 'SZ399920', 20200615, 20210615)\n", "('SZ000001', 'SH000918', 20080121, 20180611)\n", "('SZ000001', 'SZ399404', 20150520, 20180102)\n", "('SZ000001', 'SZ399405', 20131205, 20160104)\n", "('SZ000001', 'SZ399405', 20180102, 20200615)\n", "('SZ000001', 'SH000919', 20080121, 20200615)\n", "('SZ000001', 'SZ399405', 20220613, 0)\n", "('SZ000001', 'SH000919', 20210615, 0)\n", "('SZ000001', 'SZ399921', 20100129, 0)\n", "('SZ000001', 'SZ399004', 20030102, 0)\n", "('SZ000001', 'SZ399925', 20120702, 0)\n", "('SZ000001', 'SZ399371', 20100104, 20180702)\n", "('SZ000001', 'SH000803', 20120109, 20130701)\n", "('SZ000001', 'SH000803', 20141215, 20180611)\n", "('SZ000001', 'SH000803', 20190617, 20200615)\n", "('SZ000001', 'SH000803', 20201214, 20211213)\n", "('SZ000001', 'SH000803', 20220613, 0)\n", "('SZ000001', 'SZ399007', 20091104, 0)\n", "('SZ000001', 'SZ399370', 20100701, 20180702)\n", "('SZ000001', 'SW857831', 20211213, 0)\n", "('SZ000001', 'SZ399940', 20090925, 0)\n", "('SZ000001', 'SH000300', 20050408, 0)\n", "('SZ000001', 'SH000906', 20070115, 0)\n", "('SZ000001', 'SH000903', 20060529, 20220613)\n", "('SZ000001', 'SZ399918', 20080121, 20180611)\n", "('SZ000001', 'SZ399919', 20080121, 20200615)\n", "('SZ000001', 'SZ399919', 20210615, 0)\n", "('SZ000001', 'SZ399661', 20121220, 20130701)\n", "('SZ000001', 'SZ399088', 20200218, 0)\n", "('SZ000001', 'SH000971', 20101202, 0)\n", "('SZ000001', 'SZ399701', 20100510, 0)\n", "('SZ000001', 'SZ399661', 20150105, 20180702)\n", "('SZ000001', 'SH000842', 20121221, 0)\n", "('SZ000001', 'SZ399661', 20190102, 0)\n", "('SZ000001', 'SH000843', 20130701, 20160613)\n", "('SZ000001', 'SH000844', 20130107, 20130701)\n", "('SZ000001', 'SZ399314', 20050203, 0)\n", "('SZ000001', 'SH000844', 20160613, 0)\n", "('SZ000001', 'SZ399659', 20121123, 0)\n", "('SZ000001', 'SZ399400', 20130320, 0)\n", "('SZ000001', 'SH000967', 20100602, 0)\n", "('SZ000001', 'SZ399630', 20110901, 20180702)\n", "('SZ000001', 'SW801780', 20140221, 0)\n", "('SZ000001', 'SW801783', 20211213, 0)\n", "('SZ000001', 'SH000965', 20100602, 0)\n", "('SZ000001', 'SZ399980', 20110510, 0)\n", "('SZ000001', 'SZ399981', 20110613, 0)\n", "('SZ000001', 'SH000951', 20091028, 0)\n", "('SZ000001', 'SZ399631', 20110901, 20180702)\n", "('SZ000001', 'SZ399631', 20191216, 20220613)\n", "('SZ000001', 'SZ399632', 20111028, 0)\n", "('SZ000001', 'SZ399633', 20111028, 0)\n", "('SZ000001', 'SH000829', 20120806, 20130701)\n", "('SZ000001', 'SH000829', 20160613, 20180611)\n", "('SZ000001', 'SZ399011', 20110901, 0)\n", "('SZ000001', 'SH000828', 20130701, 20160613)\n", "('SZ000001', 'SH000828', 20180611, 20201214)\n", "('SZ000001', 'SZ399644', 20130201, 0)\n", "('SZ000001', 'SZ399645', 20120612, 20130701)\n", "('SZ000001', 'SZ399645', 20140701, 0)\n", "('SZ000001', 'SZ399656', 20121119, 0)\n", "('SZ000001', 'SZ399703', 20100510, 0)\n", "('SZ000001', 'SZ399657', 20121119, 0)\n", "('SZ000001', 'SH000981', 20110613, 0)\n", "('SZ000001', 'SZ399300', 20050408, 0)\n", "('SZ000001', 'SZ399662', 20130701, 20140701)\n", "('SZ000001', 'SZ399686', 20150831, 0)\n", "('SZ000001', 'SZ399002', 19950123, 0)\n", "('SZ000001', 'SW801190', 19910403, 20140221)\n", "('SZ000001', 'SW801192', 19910403, 20211213)\n", "('SZ000001', 'SZ399001', 19950123, 0)\n", "('SZ000001', 'SZ399984', 20110802, 0)\n", "('SZ000001', 'SZ399431', 20141230, 0)\n", "('SZ000001', 'SH000920', 20100129, 20180611)\n", "('SZ000001', 'SZ399985', 20110802, 0)\n", "('SZ000001', 'SZ399702', 20100510, 0)\n", "('SZ000001', 'SH000920', 20200615, 20210615)\n", "('SZ000001', 'SZ399310', 20050905, 0)\n", "('SZ000001', 'SH000921', 20100129, 0)\n", "('SZ000001', 'SZ399311', 20050203, 0)\n", "('SZ000001', 'SZ399372', 20100701, 20180702)\n", "('SZ000001', 'SZ399373', 20100104, 20180702)\n", "('SZ000001', 'SH000925', 20120702, 0)\n", "('SZ000001', 'SW851911', 19910403, 20211213)\n", "('SZ000001', 'SH000984', 20110802, 0)\n", "('SZ000001', 'SZ399903', 20060529, 20220613)\n", "('SZ000001', 'SZ399312', 20050203, 0)\n", "('SZ000001', 'SH000985', 20110802, 0)\n", "('SZ000001', 'SZ399313', 20050104, 0)\n", "('SZ000001', 'SZ399330', 20030102, 0)\n", "('SZ000001', 'SZ399986', 20130715, 0)\n", "('SZ000001', 'SZ399348', 20091104, 20220613)\n", "('SZ000001', 'SZ399344', 20091104, 0)\n", "('SZ000001', 'SZ399906', 20070115, 0)\n", "('SZ000001', 'SZ399345', 20100701, 0)\n", "('SZ000001', 'SZ399346', 20100701, 20170103)\n", "('SZ000001', 'SZ399347', 20091104, 0)\n", " SH000009 SH000010 SH000015 SH000016 SH000020 \\\n", "code m_nDate \n", "000001.SZ 2013-01-04 0 0 0 0 0 \n", " 2013-01-07 0 0 0 0 0 \n", " 2013-01-08 0 0 0 0 0 \n", " 2013-01-09 0 0 0 0 0 \n", " 2013-01-10 0 0 0 0 0 \n", "... ... ... ... ... ... \n", " 2022-07-04 0 0 0 0 0 \n", " 2022-07-05 0 0 0 0 0 \n", " 2022-07-06 0 0 0 0 0 \n", " 2022-07-07 0 0 0 0 0 \n", " 2022-07-08 0 0 0 0 0 \n", "\n", " SH000028 SH000029 SH000030 SH000031 SH000032 ... \\\n", "code m_nDate ... \n", "000001.SZ 2013-01-04 0 0 0 0 0 ... \n", " 2013-01-07 0 0 0 0 0 ... \n", " 2013-01-08 0 0 0 0 0 ... \n", " 2013-01-09 0 0 0 0 0 ... \n", " 2013-01-10 0 0 0 0 0 ... \n", "... ... ... ... ... ... ... \n", " 2022-07-04 0 0 0 0 0 ... \n", " 2022-07-05 0 0 0 0 0 ... \n", " 2022-07-06 0 0 0 0 0 ... \n", " 2022-07-07 0 0 0 0 0 ... \n", " 2022-07-08 0 0 0 0 0 ... \n", "\n", " SZ399980 SZ399981 SZ399982 SZ399983 SZ399984 \\\n", "code m_nDate \n", "000001.SZ 2013-01-04 1 1 0 0 1 \n", " 2013-01-07 1 1 0 0 1 \n", " 2013-01-08 1 1 0 0 1 \n", " 2013-01-09 1 1 0 0 1 \n", " 2013-01-10 1 1 0 0 1 \n", "... ... ... ... ... ... \n", " 2022-07-04 1 1 0 0 1 \n", " 2022-07-05 1 1 0 0 1 \n", " 2022-07-06 1 1 0 0 1 \n", " 2022-07-07 1 1 0 0 1 \n", " 2022-07-08 1 1 0 0 1 \n", "\n", " SZ399985 SZ399986 SZ399990 SZ399995 SZ399998 \n", "code m_nDate \n", "000001.SZ 2013-01-04 1 0 0 0 0 \n", " 2013-01-07 1 0 0 0 0 \n", " 2013-01-08 1 0 0 0 0 \n", " 2013-01-09 1 0 0 0 0 \n", " 2013-01-10 1 0 0 0 0 \n", "... ... ... ... ... ... \n", " 2022-07-04 1 1 0 0 0 \n", " 2022-07-05 1 1 0 0 0 \n", " 2022-07-06 1 1 0 0 0 \n", " 2022-07-07 1 1 0 0 0 \n", " 2022-07-08 1 1 0 0 0 \n", "\n", "[2309 rows x 949 columns]\n" ] } ], "source": [ "for df in _make_stock2concept_onehot():\n", " print(df)\n", " break" ] }, { "cell_type": "code", "execution_count": 69, "id": "0d307d4f-e202-4246-871b-dc5d8e9252a7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "000001.SZ SZ000001\n", "\n", " select \n", " SecId, IndexID, EnterDate, ExitDate \n", " from \n", " [IndexInfo].[dbo].[Constituents] \n", " where \n", " SecID='SZ000001'\n", " \n", "('SZ000001', 'SH000940', 20090925, 0)\n", "('SZ000001', 'SZ399619', 20110615, 0)\n", "('SZ000001', 'SH000980', 20110510, 0)\n", "('SZ000001', 'SZ399387', 20111202, 0)\n", "('SZ000001', 'SZ399920', 20100129, 20180611)\n", "('SZ000001', 'SZ399920', 20200615, 20210615)\n", "('SZ000001', 'SH000918', 20080121, 20180611)\n", "('SZ000001', 'SZ399404', 20150520, 20180102)\n", "('SZ000001', 'SZ399405', 20131205, 20160104)\n", "('SZ000001', 'SZ399405', 20180102, 20200615)\n", "('SZ000001', 'SH000919', 20080121, 20200615)\n", "('SZ000001', 'SZ399405', 20220613, 0)\n", "('SZ000001', 'SH000919', 20210615, 0)\n", "('SZ000001', 'SZ399921', 20100129, 0)\n", "('SZ000001', 'SZ399004', 20030102, 0)\n", "('SZ000001', 'SZ399925', 20120702, 0)\n", "('SZ000001', 'SZ399371', 20100104, 20180702)\n", "('SZ000001', 'SH000803', 20120109, 20130701)\n", "('SZ000001', 'SH000803', 20141215, 20180611)\n", "('SZ000001', 'SH000803', 20190617, 20200615)\n", "('SZ000001', 'SH000803', 20201214, 20211213)\n", "('SZ000001', 'SH000803', 20220613, 0)\n", "('SZ000001', 'SZ399007', 20091104, 0)\n", "('SZ000001', 'SZ399370', 20100701, 20180702)\n", "('SZ000001', 'SW857831', 20211213, 0)\n", "('SZ000001', 'SZ399940', 20090925, 0)\n", "('SZ000001', 'SH000300', 20050408, 0)\n", "('SZ000001', 'SH000906', 20070115, 0)\n", "('SZ000001', 'SH000903', 20060529, 20220613)\n", "('SZ000001', 'SZ399918', 20080121, 20180611)\n", "('SZ000001', 'SZ399919', 20080121, 20200615)\n", "('SZ000001', 'SZ399919', 20210615, 0)\n", "('SZ000001', 'SZ399661', 20121220, 20130701)\n", "('SZ000001', 'SZ399088', 20200218, 0)\n", "('SZ000001', 'SH000971', 20101202, 0)\n", "('SZ000001', 'SZ399701', 20100510, 0)\n", "('SZ000001', 'SZ399661', 20150105, 20180702)\n", "('SZ000001', 'SH000842', 20121221, 0)\n", "('SZ000001', 'SZ399661', 20190102, 0)\n", "('SZ000001', 'SH000843', 20130701, 20160613)\n", "('SZ000001', 'SH000844', 20130107, 20130701)\n", "('SZ000001', 'SZ399314', 20050203, 0)\n", "('SZ000001', 'SH000844', 20160613, 0)\n", "('SZ000001', 'SZ399659', 20121123, 0)\n", "('SZ000001', 'SZ399400', 20130320, 0)\n", "('SZ000001', 'SH000967', 20100602, 0)\n", "('SZ000001', 'SZ399630', 20110901, 20180702)\n", "('SZ000001', 'SW801780', 20140221, 0)\n", "('SZ000001', 'SW801783', 20211213, 0)\n", "('SZ000001', 'SH000965', 20100602, 0)\n", "('SZ000001', 'SZ399980', 20110510, 0)\n", "('SZ000001', 'SZ399981', 20110613, 0)\n", "('SZ000001', 'SH000951', 20091028, 0)\n", "('SZ000001', 'SZ399631', 20110901, 20180702)\n", "('SZ000001', 'SZ399631', 20191216, 20220613)\n", "('SZ000001', 'SZ399632', 20111028, 0)\n", "('SZ000001', 'SZ399633', 20111028, 0)\n", "('SZ000001', 'SH000829', 20120806, 20130701)\n", "('SZ000001', 'SH000829', 20160613, 20180611)\n", "('SZ000001', 'SZ399011', 20110901, 0)\n", "('SZ000001', 'SH000828', 20130701, 20160613)\n", "('SZ000001', 'SH000828', 20180611, 20201214)\n", "('SZ000001', 'SZ399644', 20130201, 0)\n", "('SZ000001', 'SZ399645', 20120612, 20130701)\n", "('SZ000001', 'SZ399645', 20140701, 0)\n", "('SZ000001', 'SZ399656', 20121119, 0)\n", "('SZ000001', 'SZ399703', 20100510, 0)\n", "('SZ000001', 'SZ399657', 20121119, 0)\n", "('SZ000001', 'SH000981', 20110613, 0)\n", "('SZ000001', 'SZ399300', 20050408, 0)\n", "('SZ000001', 'SZ399662', 20130701, 20140701)\n", "('SZ000001', 'SZ399686', 20150831, 0)\n", "('SZ000001', 'SZ399002', 19950123, 0)\n", "('SZ000001', 'SW801190', 19910403, 20140221)\n", "('SZ000001', 'SW801192', 19910403, 20211213)\n", "('SZ000001', 'SZ399001', 19950123, 0)\n", "('SZ000001', 'SZ399984', 20110802, 0)\n", "('SZ000001', 'SZ399431', 20141230, 0)\n", "('SZ000001', 'SH000920', 20100129, 20180611)\n", "('SZ000001', 'SZ399985', 20110802, 0)\n", "('SZ000001', 'SZ399702', 20100510, 0)\n", "('SZ000001', 'SH000920', 20200615, 20210615)\n", "('SZ000001', 'SZ399310', 20050905, 0)\n", "('SZ000001', 'SH000921', 20100129, 0)\n", "('SZ000001', 'SZ399311', 20050203, 0)\n", "('SZ000001', 'SZ399372', 20100701, 20180702)\n", "('SZ000001', 'SZ399373', 20100104, 20180702)\n", "('SZ000001', 'SH000925', 20120702, 0)\n", "('SZ000001', 'SW851911', 19910403, 20211213)\n", "('SZ000001', 'SH000984', 20110802, 0)\n", "('SZ000001', 'SZ399903', 20060529, 20220613)\n", "('SZ000001', 'SZ399312', 20050203, 0)\n", "('SZ000001', 'SH000985', 20110802, 0)\n", "('SZ000001', 'SZ399313', 20050104, 0)\n", "('SZ000001', 'SZ399330', 20030102, 0)\n", "('SZ000001', 'SZ399986', 20130715, 0)\n", "('SZ000001', 'SZ399348', 20091104, 20220613)\n", "('SZ000001', 'SZ399344', 20091104, 0)\n", "('SZ000001', 'SZ399906', 20070115, 0)\n", "('SZ000001', 'SZ399345', 20100701, 0)\n", "('SZ000001', 'SZ399346', 20100701, 20170103)\n", "('SZ000001', 'SZ399347', 20091104, 0)\n" ] } ], "source": [ "stock2concept = _make_stock2concept_onehot('000001.SZ')" ] }, { "cell_type": "code", "execution_count": 73, "id": "dbc2211d-75ec-4642-a686-ef5cd569afd6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "code m_nDate \n", "000001.SZ 2013-01-04 1\n", " 2013-01-07 1\n", " 2013-01-08 1\n", " 2013-01-09 1\n", " 2013-01-10 1\n", " ..\n", " 2022-07-04 0\n", " 2022-07-05 0\n", " 2022-07-06 0\n", " 2022-07-07 0\n", " 2022-07-08 0\n", "Name: SZ399920, Length: 2309, dtype: int64" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stock2concept['SZ399920']" ] }, { "cell_type": "code", "execution_count": 5, "id": "51dd0b40-ad19-4e82-80ac-1af35042e8b2", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | code | \n", "m_nDate | \n", "SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "SH000016 | \n", "SH000020 | \n", "SH000028 | \n", "SH000029 | \n", "SH000030 | \n", "... | \n", "SZ399980 | \n", "SZ399981 | \n", "SZ399982 | \n", "SZ399983 | \n", "SZ399984 | \n", "SZ399985 | \n", "SZ399986 | \n", "SZ399990 | \n", "SZ399995 | \n", "SZ399998 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "600000.SH | \n", "2006-01-04 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
1 | \n", "600000.SH | \n", "2006-01-05 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
2 | \n", "600000.SH | \n", "2006-01-06 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
3 | \n", "600000.SH | \n", "2006-01-09 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
4 | \n", "600000.SH | \n", "2006-01-10 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
3932 | \n", "600000.SH | \n", "2022-08-04 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "False | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3933 | \n", "600000.SH | \n", "2022-08-05 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "False | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3934 | \n", "600000.SH | \n", "2022-08-08 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "False | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3935 | \n", "600000.SH | \n", "2022-08-09 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "False | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3936 | \n", "600000.SH | \n", "2022-08-10 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "False | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3937 rows × 951 columns
\n", "\n", " | code | \n", "m_nDate | \n", "IsZt | \n", "IsDt | \n", "IsST | \n", "IsGoDelist | \n", "FloatShares | \n", "MarketValues | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "000400.SZ | \n", "2006-01-04 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.566080e+08 | \n", "1.224020e+09 | \n", "
1 | \n", "000400.SZ | \n", "2006-01-05 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.566080e+08 | \n", "1.241983e+09 | \n", "
2 | \n", "000400.SZ | \n", "2006-01-06 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.566080e+08 | \n", "1.234284e+09 | \n", "
3 | \n", "000400.SZ | \n", "2006-01-09 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.566080e+08 | \n", "1.277908e+09 | \n", "
4 | \n", "000400.SZ | \n", "2006-01-10 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.566080e+08 | \n", "1.285606e+09 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
7718 | \n", "600000.SH | \n", "2022-08-04 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.935217e+10 | \n", "2.081069e+11 | \n", "
7719 | \n", "600000.SH | \n", "2022-08-05 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.935217e+10 | \n", "2.098680e+11 | \n", "
7720 | \n", "600000.SH | \n", "2022-08-08 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.935217e+10 | \n", "2.089875e+11 | \n", "
7721 | \n", "600000.SH | \n", "2022-08-09 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.935217e+10 | \n", "2.089875e+11 | \n", "
7722 | \n", "600000.SH | \n", "2022-08-10 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "2.935217e+10 | \n", "2.081069e+11 | \n", "
7723 rows × 8 columns
\n", "\n", " | code | \n", "m_nDate | \n", "
---|---|---|
0 | \n", "600000.SH | \n", "2013-01-04 | \n", "
1 | \n", "600000.SH | \n", "2013-01-05 | \n", "
2 | \n", "600000.SH | \n", "2013-01-06 | \n", "
3 | \n", "600000.SH | \n", "2013-01-07 | \n", "
4 | \n", "600000.SH | \n", "2013-01-08 | \n", "
... | \n", "... | \n", "... | \n", "
719 | \n", "600004.SH | \n", "2013-12-27 | \n", "
720 | \n", "600004.SH | \n", "2013-12-28 | \n", "
721 | \n", "600004.SH | \n", "2013-12-29 | \n", "
722 | \n", "600004.SH | \n", "2013-12-30 | \n", "
723 | \n", "600004.SH | \n", "2013-12-31 | \n", "
724 rows × 2 columns
\n", "\n", " | code | \n", "
---|---|
0 | \n", "000400.SZ | \n", "
1 | \n", "000515.SZ | \n", "
2 | \n", "000558.SZ | \n", "
3 | \n", "000602.SZ | \n", "
4 | \n", "000677.SZ | \n", "
... | \n", "... | \n", "
5010 | \n", "688272.SH | \n", "
5011 | \n", "688320.SH | \n", "
5012 | \n", "688739.SH | \n", "
5013 | \n", "688777.SH | \n", "
5014 | \n", "830964.NE | \n", "
5015 rows × 1 columns
\n", "\n", " | code | \n", "stock_id | \n", "
---|---|---|
0 | \n", "000400.SZ | \n", "0 | \n", "
1 | \n", "000515.SZ | \n", "1 | \n", "
2 | \n", "000558.SZ | \n", "2 | \n", "
3 | \n", "000602.SZ | \n", "3 | \n", "
4 | \n", "000677.SZ | \n", "4 | \n", "
... | \n", "... | \n", "... | \n", "
5010 | \n", "688272.SH | \n", "5010 | \n", "
5011 | \n", "688320.SH | \n", "5011 | \n", "
5012 | \n", "688739.SH | \n", "5012 | \n", "
5013 | \n", "688777.SH | \n", "5013 | \n", "
5014 | \n", "830964.NE | \n", "5014 | \n", "
5015 rows × 2 columns
\n", "\n", " | code | \n", "stock_id | \n", "
---|---|---|
0 | \n", "000400.SZ | \n", "0 | \n", "
1 | \n", "000515.SZ | \n", "1 | \n", "
2 | \n", "000558.SZ | \n", "2 | \n", "
3 | \n", "000602.SZ | \n", "3 | \n", "
4 | \n", "000677.SZ | \n", "4 | \n", "
... | \n", "... | \n", "... | \n", "
5010 | \n", "688272.SH | \n", "5010 | \n", "
5011 | \n", "688320.SH | \n", "5011 | \n", "
5012 | \n", "688739.SH | \n", "5012 | \n", "
5013 | \n", "688777.SH | \n", "5013 | \n", "
5014 | \n", "830964.NE | \n", "5014 | \n", "
5015 rows × 2 columns
\n", "\n", " | cumsum_SH000016 | \n", "code | \n", "m_nDate | \n", "SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "SH000016 | \n", "SH000020 | \n", "SH000028 | \n", "SH000029 | \n", "... | \n", "SZ399980 | \n", "SZ399981 | \n", "SZ399982 | \n", "SZ399983 | \n", "SZ399984 | \n", "SZ399985 | \n", "SZ399986 | \n", "SZ399990 | \n", "SZ399995 | \n", "SZ399998 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "0 | \n", "000400.SZ | \n", "2006-01-04 | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
1 | \n", "0 | \n", "000400.SZ | \n", "2006-01-05 | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
2 | \n", "0 | \n", "000400.SZ | \n", "2006-01-06 | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
3 | \n", "0 | \n", "000400.SZ | \n", "2006-01-09 | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
4 | \n", "0 | \n", "000400.SZ | \n", "2006-01-10 | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
8569 | \n", "645 | \n", "600001.SH | \n", "2009-12-09 | \n", "False | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
8570 | \n", "645 | \n", "600001.SH | \n", "2009-12-10 | \n", "False | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
8571 | \n", "645 | \n", "600001.SH | \n", "2009-12-11 | \n", "False | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
8572 | \n", "645 | \n", "600001.SH | \n", "2009-12-14 | \n", "False | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
8573 | \n", "645 | \n", "600001.SH | \n", "2009-12-15 | \n", "False | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
8574 rows × 952 columns
\n", "\n", " | cumsum_SH000016 | \n", "code | \n", "m_nDate | \n", "SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "SH000016 | \n", "SH000020 | \n", "SH000028 | \n", "SH000029 | \n", "... | \n", "SZ399980 | \n", "SZ399981 | \n", "SZ399982 | \n", "SZ399983 | \n", "SZ399984 | \n", "SZ399985 | \n", "SZ399986 | \n", "SZ399990 | \n", "SZ399995 | \n", "SZ399998 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "600000.SH | \n", "2006-01-04 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
1 | \n", "2 | \n", "600000.SH | \n", "2006-01-05 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
2 | \n", "3 | \n", "600000.SH | \n", "2006-01-06 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
3 | \n", "4 | \n", "600000.SH | \n", "2006-01-09 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
4 | \n", "5 | \n", "600000.SH | \n", "2006-01-10 | \n", "False | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
3932 | \n", "3895 | \n", "600000.SH | \n", "2022-08-04 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3933 | \n", "3895 | \n", "600000.SH | \n", "2022-08-05 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3934 | \n", "3895 | \n", "600000.SH | \n", "2022-08-08 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3935 | \n", "3895 | \n", "600000.SH | \n", "2022-08-09 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3936 | \n", "3895 | \n", "600000.SH | \n", "2022-08-10 | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
3937 rows × 952 columns
\n", "\n", " | code | \n", "m_nDate | \n", "SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "SH000016 | \n", "SH000020 | \n", "SH000028 | \n", "SH000029 | \n", "SH000030 | \n", "... | \n", "SZ399980 | \n", "SZ399981 | \n", "SZ399982 | \n", "SZ399983 | \n", "SZ399984 | \n", "SZ399985 | \n", "SZ399986 | \n", "SZ399990 | \n", "SZ399995 | \n", "SZ399998 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "600000.SH | \n", "2006-01-04 | \n", "0 | \n", "1 | \n", "0 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
1 | \n", "600000.SH | \n", "2006-01-05 | \n", "0 | \n", "2 | \n", "0 | \n", "2 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
2 | \n", "600000.SH | \n", "2006-01-06 | \n", "0 | \n", "3 | \n", "0 | \n", "3 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
3 | \n", "600000.SH | \n", "2006-01-09 | \n", "0 | \n", "4 | \n", "0 | \n", "4 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
4 | \n", "600000.SH | \n", "2006-01-10 | \n", "0 | \n", "5 | \n", "0 | \n", "5 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "... | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
3932 | \n", "600000.SH | \n", "2022-08-04 | \n", "0 | \n", "3933 | \n", "942 | \n", "3895 | \n", "0 | \n", "2973 | \n", "3128 | \n", "2973 | \n", "... | \n", "2701 | \n", "2678 | \n", "0 | \n", "0 | \n", "2642 | \n", "2642 | \n", "2174 | \n", "0 | \n", "0 | \n", "0 | \n", "
3933 | \n", "600000.SH | \n", "2022-08-05 | \n", "0 | \n", "3934 | \n", "942 | \n", "3895 | \n", "0 | \n", "2973 | \n", "3129 | \n", "2973 | \n", "... | \n", "2702 | \n", "2679 | \n", "0 | \n", "0 | \n", "2643 | \n", "2643 | \n", "2175 | \n", "0 | \n", "0 | \n", "0 | \n", "
3934 | \n", "600000.SH | \n", "2022-08-08 | \n", "0 | \n", "3935 | \n", "942 | \n", "3895 | \n", "0 | \n", "2973 | \n", "3130 | \n", "2973 | \n", "... | \n", "2703 | \n", "2680 | \n", "0 | \n", "0 | \n", "2644 | \n", "2644 | \n", "2176 | \n", "0 | \n", "0 | \n", "0 | \n", "
3935 | \n", "600000.SH | \n", "2022-08-09 | \n", "0 | \n", "3936 | \n", "942 | \n", "3895 | \n", "0 | \n", "2973 | \n", "3131 | \n", "2973 | \n", "... | \n", "2704 | \n", "2681 | \n", "0 | \n", "0 | \n", "2645 | \n", "2645 | \n", "2177 | \n", "0 | \n", "0 | \n", "0 | \n", "
3936 | \n", "600000.SH | \n", "2022-08-10 | \n", "0 | \n", "3937 | \n", "942 | \n", "3895 | \n", "0 | \n", "2973 | \n", "3132 | \n", "2973 | \n", "... | \n", "2705 | \n", "2682 | \n", "0 | \n", "0 | \n", "2646 | \n", "2646 | \n", "2178 | \n", "0 | \n", "0 | \n", "0 | \n", "
3937 rows × 951 columns
\n", "\n", " | \n", " | SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "
---|---|---|---|---|
m_nDate | \n", "code | \n", "\n", " | \n", " | \n", " |
2006-01-04 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-05 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-06 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-09 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-10 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2022-08-04 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-05 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-08 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-09 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-10 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
7723 rows × 3 columns
\n", "\n", " | \n", " | weight | \n", "
---|---|---|
m_nDate | \n", "code | \n", "\n", " |
2006-01-04 | \n", "000400.SZ | \n", "1.000000 | \n", "
600000.SH | \n", "1.000000 | \n", "|
2006-01-05 | \n", "000400.SZ | \n", "1.024547 | \n", "
600000.SH | \n", "1.024547 | \n", "|
2006-01-06 | \n", "000400.SZ | \n", "1.049095 | \n", "
... | \n", "... | \n", "... | \n", "
2022-08-08 | \n", "600000.SH | \n", "99.950905 | \n", "
2022-08-09 | \n", "000400.SZ | \n", "99.975453 | \n", "
600000.SH | \n", "99.975453 | \n", "|
2022-08-10 | \n", "000400.SZ | \n", "100.000000 | \n", "
600000.SH | \n", "100.000000 | \n", "
7723 rows × 1 columns
\n", "\n", " | 0 | \n", "
---|---|
(2006-01-04 00:00:00, 000400.SZ) | \n", "NaN | \n", "
(2006-01-05 00:00:00, 000400.SZ) | \n", "NaN | \n", "
(2006-01-06 00:00:00, 000400.SZ) | \n", "NaN | \n", "
(2006-01-09 00:00:00, 000400.SZ) | \n", "NaN | \n", "
(2006-01-10 00:00:00, 000400.SZ) | \n", "NaN | \n", "
... | \n", "... | \n", "
1379894400000000000 | \n", "99.901810 | \n", "
1379980800000000000 | \n", "99.926358 | \n", "
1380067200000000000 | \n", "99.950905 | \n", "
1380153600000000000 | \n", "99.975453 | \n", "
1380240000000000000 | \n", "100.000000 | \n", "
11757 rows × 1 columns
\n", "\n", " | \n", " | SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "
---|---|---|---|---|
datetime | \n", "instrument | \n", "\n", " | \n", " | \n", " |
2006-01-04 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-05 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-06 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-09 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
2006-01-10 | \n", "000400.SZ | \n", "False | \n", "False | \n", "False | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2022-08-04 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-05 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-08 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-09 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
2022-08-10 | \n", "600000.SH | \n", "False | \n", "True | \n", "False | \n", "
7723 rows × 3 columns
\n", "\n", " | \n", " | SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "
---|---|---|---|---|
m_nDate | \n", "code | \n", "\n", " | \n", " | \n", " |
2006-01-04 | \n", "000400.SZ | \n", "0 | \n", "0 | \n", "0 | \n", "
2006-01-05 | \n", "000400.SZ | \n", "0 | \n", "0 | \n", "0 | \n", "
2006-01-06 | \n", "000400.SZ | \n", "0 | \n", "0 | \n", "0 | \n", "
2006-01-09 | \n", "000400.SZ | \n", "0 | \n", "0 | \n", "0 | \n", "
2006-01-10 | \n", "000400.SZ | \n", "0 | \n", "0 | \n", "0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2022-08-04 | \n", "600000.SH | \n", "0 | \n", "3933 | \n", "942 | \n", "
2022-08-05 | \n", "600000.SH | \n", "0 | \n", "3934 | \n", "942 | \n", "
2022-08-08 | \n", "600000.SH | \n", "0 | \n", "3935 | \n", "942 | \n", "
2022-08-09 | \n", "600000.SH | \n", "0 | \n", "3936 | \n", "942 | \n", "
2022-08-10 | \n", "600000.SH | \n", "0 | \n", "3937 | \n", "942 | \n", "
7723 rows × 3 columns
\n", "\n", " | code | \n", "m_nDate | \n", "SH000009 | \n", "SH000010 | \n", "SH000015 | \n", "SH000016 | \n", "SH000020 | \n", "SH000028 | \n", "SH000029 | \n", "SH000030 | \n", "... | \n", "SZ399980 | \n", "SZ399981 | \n", "SZ399982 | \n", "SZ399983 | \n", "SZ399984 | \n", "SZ399985 | \n", "SZ399986 | \n", "SZ399990 | \n", "SZ399995 | \n", "SZ399998 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "600004.SH | \n", "2013-01-04 | \n", "True | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
1 | \n", "600004.SH | \n", "2013-01-07 | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
2 | \n", "600004.SH | \n", "2013-01-08 | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
3 | \n", "600004.SH | \n", "2013-01-09 | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
4 | \n", "600004.SH | \n", "2013-01-10 | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "False | \n", "... | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "True | \n", "False | \n", "False | \n", "False | \n", "False | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
471 | \n", "600000.SH | \n", "2013-12-25 | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "True | \n", "True | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
472 | \n", "600000.SH | \n", "2013-12-26 | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "True | \n", "True | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
473 | \n", "600000.SH | \n", "2013-12-27 | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "True | \n", "True | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
474 | \n", "600000.SH | \n", "2013-12-30 | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "True | \n", "True | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
475 | \n", "600000.SH | \n", "2013-12-31 | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "True | \n", "True | \n", "True | \n", "... | \n", "True | \n", "True | \n", "False | \n", "False | \n", "True | \n", "True | \n", "True | \n", "False | \n", "False | \n", "False | \n", "
476 rows × 951 columns
\n", "