完善金字塔选股策略计算
This commit is contained in:
@@ -2,8 +2,8 @@ import os.path
|
||||
|
||||
import pandas as pd
|
||||
|
||||
# finance_root = "/Users/lanyuanxiaoyao/SynologyDrive/data/Tushare"
|
||||
finance_root = "C:\\Users\\lanyuanxiaoyao\\Documents\\Tushare"
|
||||
finance_root = "/Users/lanyuanxiaoyao/SynologyDrive/data/Tushare"
|
||||
# finance_root = "C:\\Users\\lanyuanxiaoyao\\Documents\\Tushare"
|
||||
|
||||
|
||||
def load_balance_sheet():
|
||||
|
||||
747
财报筛选/金字塔选股.ipynb
747
财报筛选/金字塔选股.ipynb
@@ -6,25 +6,25 @@
|
||||
"metadata": {
|
||||
"collapsed": true,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:26.631868Z",
|
||||
"start_time": "2025-01-19T16:42:26.628635Z"
|
||||
"end_time": "2025-01-20T09:12:32.313699Z",
|
||||
"start_time": "2025-01-20T09:12:32.310753Z"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"import numpy as np\n",
|
||||
"\n",
|
||||
"import pandas as pd\n",
|
||||
"import tushare as ts\n",
|
||||
"\n",
|
||||
"ts_pro = ts.pro_api(token=\"64ebff4fa679167600b905ee45dd88e76f3963c0ff39157f3f085f0e\")"
|
||||
],
|
||||
"outputs": [],
|
||||
"execution_count": 459
|
||||
"execution_count": 99
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:27.857016Z",
|
||||
"start_time": "2025-01-19T16:42:26.639161Z"
|
||||
"end_time": "2025-01-20T09:12:35.800981Z",
|
||||
"start_time": "2025-01-20T09:12:32.319361Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -77,7 +77,7 @@
|
||||
],
|
||||
"id": "68b2debc14502fd5",
|
||||
"outputs": [],
|
||||
"execution_count": 460
|
||||
"execution_count": 100
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -88,15 +88,15 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:27.931899Z",
|
||||
"start_time": "2025-01-19T16:42:27.868963Z"
|
||||
"end_time": "2025-01-20T09:12:35.994681Z",
|
||||
"start_time": "2025-01-20T09:12:35.828990Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": "finance_df = finance_df.groupby(\"code\").filter(lambda x: len(x) > 6)",
|
||||
"id": "4293bd93ea8f9ed",
|
||||
"outputs": [],
|
||||
"execution_count": 461
|
||||
"execution_count": 101
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -118,8 +118,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:29.192712Z",
|
||||
"start_time": "2025-01-19T16:42:27.946033Z"
|
||||
"end_time": "2025-01-20T09:12:38.908153Z",
|
||||
"start_time": "2025-01-20T09:12:36.022143Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -151,12 +151,12 @@
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"C:\\Users\\lanyuanxiaoyao\\AppData\\Local\\Temp\\ipykernel_28824\\1604170078.py:20: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
|
||||
"/var/folders/7h/w0cmp4zj6mn9br_6nyj310m40000gn/T/ipykernel_72996/1604170078.py:20: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
|
||||
" finance_df = finance_df.groupby(\"code\").apply(reset_score_for_average_roe).reset_index(drop=True)\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 462
|
||||
"execution_count": 102
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -173,8 +173,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:29.363249Z",
|
||||
"start_time": "2025-01-19T16:42:29.219453Z"
|
||||
"end_time": "2025-01-20T09:12:39.103417Z",
|
||||
"start_time": "2025-01-20T09:12:38.937447Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -190,7 +190,7 @@
|
||||
],
|
||||
"id": "3b585cf8e2eb5e3",
|
||||
"outputs": [],
|
||||
"execution_count": 463
|
||||
"execution_count": 103
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -206,8 +206,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:29.878285Z",
|
||||
"start_time": "2025-01-19T16:42:29.369862Z"
|
||||
"end_time": "2025-01-20T09:12:39.922683Z",
|
||||
"start_time": "2025-01-20T09:12:39.130104Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -221,7 +221,7 @@
|
||||
],
|
||||
"id": "fd5582e080102e20",
|
||||
"outputs": [],
|
||||
"execution_count": 464
|
||||
"execution_count": 104
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -237,8 +237,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:29.905727Z",
|
||||
"start_time": "2025-01-19T16:42:29.889468Z"
|
||||
"end_time": "2025-01-20T09:12:39.965030Z",
|
||||
"start_time": "2025-01-20T09:12:39.946246Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -258,7 +258,7 @@
|
||||
],
|
||||
"id": "bc92e050c82c3768",
|
||||
"outputs": [],
|
||||
"execution_count": 465
|
||||
"execution_count": 105
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -282,8 +282,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:29.923829Z",
|
||||
"start_time": "2025-01-19T16:42:29.916781Z"
|
||||
"end_time": "2025-01-20T09:12:40.003327Z",
|
||||
"start_time": "2025-01-20T09:12:39.990482Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -312,7 +312,7 @@
|
||||
],
|
||||
"id": "baeb44a4fb28b60b",
|
||||
"outputs": [],
|
||||
"execution_count": 466
|
||||
"execution_count": 106
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -327,8 +327,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:30.005541Z",
|
||||
"start_time": "2025-01-19T16:42:29.935348Z"
|
||||
"end_time": "2025-01-20T09:12:40.179998Z",
|
||||
"start_time": "2025-01-20T09:12:40.027705Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -336,14 +336,15 @@
|
||||
"finance_df[\"gross_profit_ratio\"] = (finance_df[\"total_revenue\"] - finance_df[\"operating_costs\"]) / finance_df[\n",
|
||||
" \"total_revenue\"]\n",
|
||||
"finance_df[\"gross_profit_ratio_std\"] = finance_df.groupby(\"code\")[\"gross_profit_ratio\"].rolling(\n",
|
||||
" window=5).std().reset_index(0, drop=True)\n",
|
||||
" window=5\n",
|
||||
").std().reset_index(0, drop=True)\n",
|
||||
"finance_df[\"score_gross_profit_ratio\"] = 0\n",
|
||||
"finance_df[(not finance_df[\"gross_profit_ratio_std\"].isna) & (finance_df[\"gross_profit_ratio_std\"] < 30)] = 50\n",
|
||||
"finance_df[\"score\"] += finance_df[\"score_gross_profit_ratio\"]"
|
||||
],
|
||||
"id": "9d23bdf60a1839c9",
|
||||
"outputs": [],
|
||||
"execution_count": 467
|
||||
"execution_count": 107
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -360,8 +361,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:30.022774Z",
|
||||
"start_time": "2025-01-19T16:42:30.016550Z"
|
||||
"end_time": "2025-01-20T09:12:40.213136Z",
|
||||
"start_time": "2025-01-20T09:12:40.205548Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -376,7 +377,7 @@
|
||||
],
|
||||
"id": "f7d9486af89cb710",
|
||||
"outputs": [],
|
||||
"execution_count": 468
|
||||
"execution_count": 108
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -394,8 +395,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-19T16:42:46.378919Z",
|
||||
"start_time": "2025-01-19T16:42:30.718209Z"
|
||||
"end_time": "2025-01-20T09:12:57.833029Z",
|
||||
"start_time": "2025-01-20T09:12:40.241875Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -404,28 +405,29 @@
|
||||
" # 计算 score_net_income_1\n",
|
||||
" group['net_income_shift_1'] = group['net_income'].shift(1)\n",
|
||||
" group['score_net_income_1'] = (group['net_income'] > group['net_income_shift_1']).map(\n",
|
||||
" {True: 30, False: -30})\n",
|
||||
" group = group.mask(pd.isna(group[\"net_income_shift_1\"]), other=0)\n",
|
||||
" {True: 30, False: -30}\n",
|
||||
" )\n",
|
||||
" # 计算 score_net_income_2\n",
|
||||
" group['net_income_shift_2'] = group['net_income'].shift(2)\n",
|
||||
" group['score_net_income_2'] = (group['net_income_shift_1'] > group['net_income_shift_2']).map(\n",
|
||||
" {True: 25, False: -25})\n",
|
||||
" {True: 25, False: -25}\n",
|
||||
" )\n",
|
||||
" # 计算 score_net_income_3\n",
|
||||
" group['net_income_shift_3'] = group['net_income'].shift(3)\n",
|
||||
" group['score_net_income_3'] = (group['net_income_shift_2'] > group['net_income_shift_3']).map(\n",
|
||||
" {True: 20, False: -20})\n",
|
||||
" {True: 20, False: -20}\n",
|
||||
" )\n",
|
||||
" # 计算 score_net_income_4\n",
|
||||
" group['net_income_shift_4'] = group['net_income'].shift(4)\n",
|
||||
" group['score_net_income_4'] = (group['net_income_shift_3'] > group['net_income_shift_4']).map(\n",
|
||||
" {True: 15, False: -15}).fillna(0)\n",
|
||||
" {True: 15, False: -15}\n",
|
||||
" )\n",
|
||||
" return group\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"finance_df = finance_df.groupby(\"code\").apply(score_by_net_income_ascending).reset_index(drop=True)\n",
|
||||
"finance_df[\"score_net_income_ascending\"] = np.sum(\n",
|
||||
" [finance_df[\"score_net_income_1\"], finance_df[\"score_net_income_2\"], finance_df[\"score_net_income_3\"],\n",
|
||||
" finance_df[\"score_net_income_4\"]], axis=0)\n",
|
||||
"finance_df"
|
||||
"finance_df[\"score_net_income_ascending\"] = finance_df[\"score_net_income_1\"] + finance_df[\"score_net_income_2\"] + \\\n",
|
||||
" finance_df[\"score_net_income_3\"] + finance_df[\"score_net_income_4\"]"
|
||||
],
|
||||
"id": "2d1ca7fc7873ce71",
|
||||
"outputs": [
|
||||
@@ -433,92 +435,107 @@
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"C:\\Users\\lanyuanxiaoyao\\AppData\\Local\\Temp\\ipykernel_28824\\3206398043.py:22: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
|
||||
"/var/folders/7h/w0cmp4zj6mn9br_6nyj310m40000gn/T/ipykernel_72996/432379325.py:25: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
|
||||
" finance_df = finance_df.groupby(\"code\").apply(score_by_net_income_ascending).reset_index(drop=True)\n"
|
||||
]
|
||||
},
|
||||
}
|
||||
],
|
||||
"execution_count": 109
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-20T09:13:15.433529Z",
|
||||
"start_time": "2025-01-20T09:12:57.864097Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"def score_by_operating_net_cash_flow_ascending(group):\n",
|
||||
" # 计算 score_operating_net_cash_flow_1\n",
|
||||
" group['operating_net_cash_flow_shift_1'] = group['operating_net_cash_flow'].shift(1)\n",
|
||||
" group['score_operating_net_cash_flow_1'] = (\n",
|
||||
" group['operating_net_cash_flow'] > group['operating_net_cash_flow_shift_1']).map(\n",
|
||||
" {True: 30, False: -30}\n",
|
||||
" )\n",
|
||||
" # 计算 score_operating_net_cash_flow_2\n",
|
||||
" group['operating_net_cash_flow_shift_2'] = group['operating_net_cash_flow'].shift(2)\n",
|
||||
" group['score_operating_net_cash_flow_2'] = (\n",
|
||||
" group['operating_net_cash_flow_shift_1'] > group['operating_net_cash_flow_shift_2']).map(\n",
|
||||
" {True: 25, False: -25}\n",
|
||||
" )\n",
|
||||
" # 计算 score_operating_net_cash_flow_3\n",
|
||||
" group['operating_net_cash_flow_shift_3'] = group['operating_net_cash_flow'].shift(3)\n",
|
||||
" group['score_operating_net_cash_flow_3'] = (\n",
|
||||
" group['operating_net_cash_flow_shift_2'] > group['operating_net_cash_flow_shift_3']).map(\n",
|
||||
" {True: 20, False: -20}\n",
|
||||
" )\n",
|
||||
" # 计算 score_operating_net_cash_flow_4\n",
|
||||
" group['operating_net_cash_flow_shift_4'] = group['operating_net_cash_flow'].shift(4)\n",
|
||||
" group['score_operating_net_cash_flow_4'] = (\n",
|
||||
" group['operating_net_cash_flow_shift_3'] > group['operating_net_cash_flow_shift_4']).map(\n",
|
||||
" {True: 15, False: -15}\n",
|
||||
" )\n",
|
||||
" return group\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"finance_df = finance_df.groupby(\"code\").apply(score_by_operating_net_cash_flow_ascending).reset_index(drop=True)\n",
|
||||
"finance_df[\"score_operating_net_cash_flow_ascending\"] = finance_df[\"score_operating_net_cash_flow_1\"] + finance_df[\n",
|
||||
" \"score_operating_net_cash_flow_2\"] + finance_df[\"score_operating_net_cash_flow_3\"] + finance_df[\n",
|
||||
" \"score_operating_net_cash_flow_4\"]"
|
||||
],
|
||||
"id": "a90f3721487bd635",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/var/folders/7h/w0cmp4zj6mn9br_6nyj310m40000gn/T/ipykernel_72996/2138932640.py:29: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
|
||||
" finance_df = finance_df.groupby(\"code\").apply(score_by_operating_net_cash_flow_ascending).reset_index(drop=True)\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 110
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-01-20T09:15:08.342704Z",
|
||||
"start_time": "2025-01-20T09:15:08.302792Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"result_df = finance_df.sort_values(by=['score'], ascending=False, inplace=False)[[\"code\", \"score\"]]\n",
|
||||
"result_df = result_df.drop_duplicates(\"code\")\n",
|
||||
"result_df[:20]"
|
||||
],
|
||||
"id": "ef9e6259efc1c1d0",
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
" code year total_stockholder_interest net_income \\\n",
|
||||
"0 0 0 0.000000e+00 0.000000e+00 \n",
|
||||
"1 000001.SZ 2006 6.474463e+09 1.302907e+09 \n",
|
||||
"2 000001.SZ 2007 1.300606e+10 2.649903e+09 \n",
|
||||
"3 000001.SZ 2008 1.640079e+10 6.140350e+08 \n",
|
||||
"4 000001.SZ 2009 2.046961e+10 5.030729e+09 \n",
|
||||
"... ... ... ... ... \n",
|
||||
"70725 871981.BJ 2019 1.484536e+08 1.933833e+07 \n",
|
||||
"70726 871981.BJ 2020 1.963500e+08 3.113004e+07 \n",
|
||||
"70727 871981.BJ 2021 4.901179e+08 6.549797e+07 \n",
|
||||
"70728 871981.BJ 2022 5.238630e+08 4.359533e+07 \n",
|
||||
"70729 871981.BJ 2023 5.044336e+08 -5.665176e+06 \n",
|
||||
"\n",
|
||||
" total_assets total_revenue inventories accounts_receivable \\\n",
|
||||
"0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 \n",
|
||||
"1 2.605763e+11 7.135218e+09 NaN NaN \n",
|
||||
"2 3.525394e+11 1.080750e+10 NaN NaN \n",
|
||||
"3 4.744402e+11 1.451312e+10 NaN NaN \n",
|
||||
"4 5.878110e+11 1.511444e+10 NaN NaN \n",
|
||||
"... ... ... ... ... \n",
|
||||
"70725 3.438787e+08 2.288707e+08 6.439933e+07 9.145441e+07 \n",
|
||||
"70726 4.407381e+08 3.221584e+08 7.076865e+07 1.028702e+08 \n",
|
||||
"70727 7.806398e+08 4.748939e+08 1.102946e+08 1.094223e+08 \n",
|
||||
"70728 8.141886e+08 3.872667e+08 1.034502e+08 7.252802e+07 \n",
|
||||
"70729 7.671820e+08 3.613133e+08 1.070212e+08 7.962033e+07 \n",
|
||||
"\n",
|
||||
" operating_costs operating_profit ... score_operating_safety_margin \\\n",
|
||||
"0 0.000000e+00 0.000000e+00 ... 0 \n",
|
||||
"1 NaN 1.905169e+09 ... 0 \n",
|
||||
"2 NaN 3.721942e+09 ... 0 \n",
|
||||
"3 NaN 8.034260e+08 ... 0 \n",
|
||||
"4 NaN 6.159127e+09 ... 0 \n",
|
||||
"... ... ... ... ... \n",
|
||||
"70725 1.759984e+08 1.982603e+07 ... 0 \n",
|
||||
"70726 2.444144e+08 3.466142e+07 ... 0 \n",
|
||||
"70727 3.501988e+08 7.194507e+07 ... 0 \n",
|
||||
"70728 3.141146e+08 2.827675e+07 ... 0 \n",
|
||||
"70729 3.220560e+08 -1.192680e+07 ... 0 \n",
|
||||
"\n",
|
||||
" net_income_shift_1 score_net_income_1 net_income_shift_2 \\\n",
|
||||
"0 0.000000e+00 0 NaN \n",
|
||||
"1 3.110076e+08 30 NaN \n",
|
||||
"2 1.302907e+09 30 0.000000e+00 \n",
|
||||
"3 2.649903e+09 -30 1.302907e+09 \n",
|
||||
"4 6.140350e+08 30 2.649903e+09 \n",
|
||||
"... ... ... ... \n",
|
||||
"70725 1.875294e+07 30 9.625220e+06 \n",
|
||||
"70726 1.933833e+07 30 1.875294e+07 \n",
|
||||
"70727 3.113004e+07 30 1.933833e+07 \n",
|
||||
"70728 6.549797e+07 -30 3.113004e+07 \n",
|
||||
"70729 4.359533e+07 -30 6.549797e+07 \n",
|
||||
"\n",
|
||||
" score_net_income_2 net_income_shift_3 score_net_income_3 \\\n",
|
||||
"0 -25 NaN -20 \n",
|
||||
"1 -25 NaN -20 \n",
|
||||
"2 25 NaN -20 \n",
|
||||
"3 25 0.000000e+00 20 \n",
|
||||
"4 -25 1.302907e+09 20 \n",
|
||||
"... ... ... ... \n",
|
||||
"70725 25 0.000000e+00 20 \n",
|
||||
"70726 25 9.625220e+06 20 \n",
|
||||
"70727 25 1.875294e+07 20 \n",
|
||||
"70728 25 1.933833e+07 20 \n",
|
||||
"70729 -25 3.113004e+07 20 \n",
|
||||
"\n",
|
||||
" net_income_shift_4 score_net_income_4 score_net_income_ascending \n",
|
||||
"0 NaN -15 -60 \n",
|
||||
"1 NaN -15 -30 \n",
|
||||
"2 NaN -15 20 \n",
|
||||
"3 NaN -15 0 \n",
|
||||
"4 0.00 15 40 \n",
|
||||
"... ... ... ... \n",
|
||||
"70725 NaN -15 60 \n",
|
||||
"70726 0.00 15 90 \n",
|
||||
"70727 9625220.11 15 90 \n",
|
||||
"70728 18752944.38 15 30 \n",
|
||||
"70729 19338331.78 15 -20 \n",
|
||||
"\n",
|
||||
"[70730 rows x 46 columns]"
|
||||
" code score\n",
|
||||
"48060 600519.SH 810\n",
|
||||
"45062 600309.SH 810\n",
|
||||
"58715 601919.SH 790\n",
|
||||
"17006 002415.SZ 750\n",
|
||||
"3252 000587.SZ 710\n",
|
||||
"4129 000651.SZ 710\n",
|
||||
"64547 603868.SH 710\n",
|
||||
"56747 601225.SH 710\n",
|
||||
"4457 000672.SZ 710\n",
|
||||
"3031 000568.SZ 710\n",
|
||||
"8872 001201.SZ 710\n",
|
||||
"31827 300390.SZ 710\n",
|
||||
"65769 605098.SH 710\n",
|
||||
"46474 600398.SH 710\n",
|
||||
"65749 605089.SH 710\n",
|
||||
"64240 603816.SH 710\n",
|
||||
"47860 600507.SH 710\n",
|
||||
"33696 300533.SZ 710\n",
|
||||
"27948 300146.SZ 710\n",
|
||||
"35448 300677.SZ 710"
|
||||
],
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
@@ -540,439 +557,121 @@
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>code</th>\n",
|
||||
" <th>year</th>\n",
|
||||
" <th>total_stockholder_interest</th>\n",
|
||||
" <th>net_income</th>\n",
|
||||
" <th>total_assets</th>\n",
|
||||
" <th>total_revenue</th>\n",
|
||||
" <th>inventories</th>\n",
|
||||
" <th>accounts_receivable</th>\n",
|
||||
" <th>operating_costs</th>\n",
|
||||
" <th>operating_profit</th>\n",
|
||||
" <th>...</th>\n",
|
||||
" <th>score_operating_safety_margin</th>\n",
|
||||
" <th>net_income_shift_1</th>\n",
|
||||
" <th>score_net_income_1</th>\n",
|
||||
" <th>net_income_shift_2</th>\n",
|
||||
" <th>score_net_income_2</th>\n",
|
||||
" <th>net_income_shift_3</th>\n",
|
||||
" <th>score_net_income_3</th>\n",
|
||||
" <th>net_income_shift_4</th>\n",
|
||||
" <th>score_net_income_4</th>\n",
|
||||
" <th>score_net_income_ascending</th>\n",
|
||||
" <th>score</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-25</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-20</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-15</td>\n",
|
||||
" <td>-60</td>\n",
|
||||
" <th>48060</th>\n",
|
||||
" <td>600519.SH</td>\n",
|
||||
" <td>810</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>000001.SZ</td>\n",
|
||||
" <td>2006</td>\n",
|
||||
" <td>6.474463e+09</td>\n",
|
||||
" <td>1.302907e+09</td>\n",
|
||||
" <td>2.605763e+11</td>\n",
|
||||
" <td>7.135218e+09</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1.905169e+09</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3.110076e+08</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-25</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-20</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-15</td>\n",
|
||||
" <td>-30</td>\n",
|
||||
" <th>45062</th>\n",
|
||||
" <td>600309.SH</td>\n",
|
||||
" <td>810</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>000001.SZ</td>\n",
|
||||
" <td>2007</td>\n",
|
||||
" <td>1.300606e+10</td>\n",
|
||||
" <td>2.649903e+09</td>\n",
|
||||
" <td>3.525394e+11</td>\n",
|
||||
" <td>1.080750e+10</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>3.721942e+09</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1.302907e+09</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-20</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-15</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <th>58715</th>\n",
|
||||
" <td>601919.SH</td>\n",
|
||||
" <td>790</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>000001.SZ</td>\n",
|
||||
" <td>2008</td>\n",
|
||||
" <td>1.640079e+10</td>\n",
|
||||
" <td>6.140350e+08</td>\n",
|
||||
" <td>4.744402e+11</td>\n",
|
||||
" <td>1.451312e+10</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>8.034260e+08</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2.649903e+09</td>\n",
|
||||
" <td>-30</td>\n",
|
||||
" <td>1.302907e+09</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-15</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <th>17006</th>\n",
|
||||
" <td>002415.SZ</td>\n",
|
||||
" <td>750</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>000001.SZ</td>\n",
|
||||
" <td>2009</td>\n",
|
||||
" <td>2.046961e+10</td>\n",
|
||||
" <td>5.030729e+09</td>\n",
|
||||
" <td>5.878110e+11</td>\n",
|
||||
" <td>1.511444e+10</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>6.159127e+09</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>6.140350e+08</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <td>2.649903e+09</td>\n",
|
||||
" <td>-25</td>\n",
|
||||
" <td>1.302907e+09</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>0.00</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <th>3252</th>\n",
|
||||
" <td>000587.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>...</th>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <th>4129</th>\n",
|
||||
" <td>000651.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>70725</th>\n",
|
||||
" <td>871981.BJ</td>\n",
|
||||
" <td>2019</td>\n",
|
||||
" <td>1.484536e+08</td>\n",
|
||||
" <td>1.933833e+07</td>\n",
|
||||
" <td>3.438787e+08</td>\n",
|
||||
" <td>2.288707e+08</td>\n",
|
||||
" <td>6.439933e+07</td>\n",
|
||||
" <td>9.145441e+07</td>\n",
|
||||
" <td>1.759984e+08</td>\n",
|
||||
" <td>1.982603e+07</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1.875294e+07</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <td>9.625220e+06</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>0.000000e+00</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>-15</td>\n",
|
||||
" <td>60</td>\n",
|
||||
" <th>64547</th>\n",
|
||||
" <td>603868.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>70726</th>\n",
|
||||
" <td>871981.BJ</td>\n",
|
||||
" <td>2020</td>\n",
|
||||
" <td>1.963500e+08</td>\n",
|
||||
" <td>3.113004e+07</td>\n",
|
||||
" <td>4.407381e+08</td>\n",
|
||||
" <td>3.221584e+08</td>\n",
|
||||
" <td>7.076865e+07</td>\n",
|
||||
" <td>1.028702e+08</td>\n",
|
||||
" <td>2.444144e+08</td>\n",
|
||||
" <td>3.466142e+07</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1.933833e+07</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <td>1.875294e+07</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>9.625220e+06</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>0.00</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>90</td>\n",
|
||||
" <th>56747</th>\n",
|
||||
" <td>601225.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>70727</th>\n",
|
||||
" <td>871981.BJ</td>\n",
|
||||
" <td>2021</td>\n",
|
||||
" <td>4.901179e+08</td>\n",
|
||||
" <td>6.549797e+07</td>\n",
|
||||
" <td>7.806398e+08</td>\n",
|
||||
" <td>4.748939e+08</td>\n",
|
||||
" <td>1.102946e+08</td>\n",
|
||||
" <td>1.094223e+08</td>\n",
|
||||
" <td>3.501988e+08</td>\n",
|
||||
" <td>7.194507e+07</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3.113004e+07</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <td>1.933833e+07</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>1.875294e+07</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>9625220.11</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>90</td>\n",
|
||||
" <th>4457</th>\n",
|
||||
" <td>000672.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>70728</th>\n",
|
||||
" <td>871981.BJ</td>\n",
|
||||
" <td>2022</td>\n",
|
||||
" <td>5.238630e+08</td>\n",
|
||||
" <td>4.359533e+07</td>\n",
|
||||
" <td>8.141886e+08</td>\n",
|
||||
" <td>3.872667e+08</td>\n",
|
||||
" <td>1.034502e+08</td>\n",
|
||||
" <td>7.252802e+07</td>\n",
|
||||
" <td>3.141146e+08</td>\n",
|
||||
" <td>2.827675e+07</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>6.549797e+07</td>\n",
|
||||
" <td>-30</td>\n",
|
||||
" <td>3.113004e+07</td>\n",
|
||||
" <td>25</td>\n",
|
||||
" <td>1.933833e+07</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>18752944.38</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>30</td>\n",
|
||||
" <th>3031</th>\n",
|
||||
" <td>000568.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>70729</th>\n",
|
||||
" <td>871981.BJ</td>\n",
|
||||
" <td>2023</td>\n",
|
||||
" <td>5.044336e+08</td>\n",
|
||||
" <td>-5.665176e+06</td>\n",
|
||||
" <td>7.671820e+08</td>\n",
|
||||
" <td>3.613133e+08</td>\n",
|
||||
" <td>1.070212e+08</td>\n",
|
||||
" <td>7.962033e+07</td>\n",
|
||||
" <td>3.220560e+08</td>\n",
|
||||
" <td>-1.192680e+07</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>4.359533e+07</td>\n",
|
||||
" <td>-30</td>\n",
|
||||
" <td>6.549797e+07</td>\n",
|
||||
" <td>-25</td>\n",
|
||||
" <td>3.113004e+07</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>19338331.78</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>-20</td>\n",
|
||||
" <th>8872</th>\n",
|
||||
" <td>001201.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>31827</th>\n",
|
||||
" <td>300390.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>65769</th>\n",
|
||||
" <td>605098.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>46474</th>\n",
|
||||
" <td>600398.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>65749</th>\n",
|
||||
" <td>605089.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>64240</th>\n",
|
||||
" <td>603816.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>47860</th>\n",
|
||||
" <td>600507.SH</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>33696</th>\n",
|
||||
" <td>300533.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>27948</th>\n",
|
||||
" <td>300146.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>35448</th>\n",
|
||||
" <td>300677.SZ</td>\n",
|
||||
" <td>710</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"<p>70730 rows × 46 columns</p>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
"execution_count": 469,
|
||||
"execution_count": 114,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"execution_count": 469
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"def score_by_net_income_ascending(code):\n",
|
||||
" temp_df = finance_df[finance_df[\"code\"] == code].copy()[[\"year\", \"net_income\"]]\n",
|
||||
" temp_df.sort_values(by=\"year\", ascending=False, inplace=True)\n",
|
||||
" temp_df.set_index(keys=\"year\", drop=True, inplace=True)\n",
|
||||
"\n",
|
||||
" score = 0\n",
|
||||
" if temp_df.iloc[0].values[0] > temp_df.iloc[1].values[0]:\n",
|
||||
" score += 30\n",
|
||||
" else:\n",
|
||||
" score -= 30\n",
|
||||
"\n",
|
||||
" if temp_df.iloc[1].values[0] > temp_df.iloc[2].values[0]:\n",
|
||||
" score += 25\n",
|
||||
" else:\n",
|
||||
" score -= 25\n",
|
||||
"\n",
|
||||
" if temp_df.iloc[2].values[0] > temp_df.iloc[3].values[0]:\n",
|
||||
" score += 20\n",
|
||||
" else:\n",
|
||||
" score -= 20\n",
|
||||
"\n",
|
||||
" if temp_df.iloc[3].values[0] > temp_df.iloc[4].values[0]:\n",
|
||||
" score += 15\n",
|
||||
" else:\n",
|
||||
" score -= 15\n",
|
||||
"\n",
|
||||
" return score\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"codes = list(map(lambda x: add_score(x, score_by_net_income_ascending(x[0])), codes))"
|
||||
],
|
||||
"id": "4ab6a7b485dc9349",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"def score_by_operating_net_cash_flow_ascending(code):\n",
|
||||
" temp_df = finance_df[finance_df[\"code\"] == code].copy()[[\"year\", \"operating_net_cash_flow\"]]\n",
|
||||
" temp_df.sort_values(by=\"year\", ascending=False, inplace=True)\n",
|
||||
" temp_df.set_index(keys=\"year\", drop=True, inplace=True)\n",
|
||||
"\n",
|
||||
" score = 0\n",
|
||||
" if temp_df.iloc[0].values[0] > temp_df.iloc[1].values[0]:\n",
|
||||
" score += 30\n",
|
||||
" else:\n",
|
||||
" score -= 30\n",
|
||||
"\n",
|
||||
" if temp_df.iloc[1].values[0] > temp_df.iloc[2].values[0]:\n",
|
||||
" score += 25\n",
|
||||
" else:\n",
|
||||
" score -= 25\n",
|
||||
"\n",
|
||||
" if temp_df.iloc[2].values[0] > temp_df.iloc[3].values[0]:\n",
|
||||
" score += 20\n",
|
||||
" else:\n",
|
||||
" score -= 20\n",
|
||||
"\n",
|
||||
" if temp_df.iloc[3].values[0] > temp_df.iloc[4].values[0]:\n",
|
||||
" score += 15\n",
|
||||
" else:\n",
|
||||
" score -= 15\n",
|
||||
"\n",
|
||||
" return score\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"codes = list(map(lambda x: add_score(x, score_by_operating_net_cash_flow_ascending(x[0])), codes))"
|
||||
],
|
||||
"id": "d6644089e803a79d",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"df = pd.DataFrame(\n",
|
||||
" codes,\n",
|
||||
" columns=[\"code\", \"name\", \"score\", \"roe_score\", \"roa_score\", \"net_income\", \"assets_turnover_and_cash\",\n",
|
||||
" \"collection_cash_period_and_sales_period\", \"gross_profit_ratio_volatility\",\n",
|
||||
" \"operating_safety_margin\", \"net_income_ascending\",\n",
|
||||
" \"operating_net_cash_flow_ascending\"]\n",
|
||||
")\n",
|
||||
"df.sort_values(by=\"score\", ascending=False, inplace=True)\n",
|
||||
"df"
|
||||
],
|
||||
"id": "ef9e6259efc1c1d0",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": "df[:100][\"code\"]",
|
||||
"id": "32b5b4778985afaa",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"temp_df = finance_df[finance_df[\"code\"] == \"600763.SH\"]\n",
|
||||
"cal_roe(temp_df)\n",
|
||||
"cal_roa(temp_df)\n",
|
||||
"temp_df[[\"year\", \"roe\", \"roa\"]]"
|
||||
],
|
||||
"id": "e6d973f4ff98ebef",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"temp_df = ts_pro.fina_indicator(\n",
|
||||
" ts_code=\"600763.SH\", start_date=\"20140101\", end_date=\"20241231\",\n",
|
||||
" fields=\"ts_code,end_date,roe,roa\"\n",
|
||||
")\n",
|
||||
"temp_df = temp_df[temp_df[\"end_date\"].str.endswith(\"1231\")]\n",
|
||||
"# temp_df[\"end_date\"] = temp_df[\"end_date\"].str[:4]\n",
|
||||
"# temp_df = temp_df.drop_duplicates(subset=[\"end_date\"], keep=\"last\")\n",
|
||||
"temp_df"
|
||||
],
|
||||
"id": "b220252765677c76",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
"execution_count": 114
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user