{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "8dd1bdcc-05d0-4623-b683-4eec9339a4ae", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "094cfb08-c902-4d37-a8d3-4600dd371140", "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv('tinysoft-data/44.合并资产负债表/SH600058.csv')" ] }, { "cell_type": "code", "execution_count": 3, "id": "f5605ce4-c5f1-4bf8-afe5-4eb360fcd26c", "metadata": {}, "outputs": [], "source": [ "from pprint import pprint" ] }, { "cell_type": "code", "execution_count": 4, "id": "8b7abc47-accc-47d1-8f16-d5206b410b16", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "range(9900000, 9900028)\n" ] } ], "source": [ "pershare_indicator_id_list = range(9900000, 9900028)\n", "print(pershare_indicator_id_list)" ] }, { "cell_type": "code", "execution_count": 1, "id": "f86a7c11-2ecb-4d7c-bdc0-29486b2ee86d", "metadata": {}, "outputs": [], "source": [ "import pyTSL\n", "import itertools\n", "import pandas as pd\n", "from pprint import pprint\n", "\n", "TINYSOFT_HOSTNAME = 'tsl.tinysoft.com.cn'\n", "TINYSOFT_PORT = 443\n", "TINYSOFT_USERNAME = 'xunuo2005'\n", "TINYSOFT_PASSWORD = '20220613'\n", "\n", "TINYSOFT_DATA_PATH = 'tinysoft-data'\n", "\n", "class tsl():\n", " \n", " def __enter__(self):\n", " self.c = pyTSL.Client(TINYSOFT_USERNAME, TINYSOFT_PASSWORD, TINYSOFT_HOSTNAME, 443)\n", " status = self.c.login()\n", " return self\n", " \n", " \n", " def __exit__(self, exc_type, exc_val, exc_tb):\n", " self.c.logout()\n", " \n", " \n", " def retrieve_stock_report(self, table_id, stock_id, start_date):\n", " code = \"\"\"\n", " SetSysParam('ReportMode', -1);\n", " return Select * \n", " from infotable {table_id} of '{stock_id}' \n", " where ['截止日'] >= {start_date}\n", " end;\n", " \"\"\".format(table_id=table_id, stock_id=stock_id, start_date=start_date)\n", " r = self.c.exec(code)\n", "\n", " df = pd.DataFrame(r.value())\n", " return df\n", " \n", " \n", " def retrieve_stock_indicator(self, stock_id, start_year, indicator_config_fname):\n", " year_list = range(start_year, 2022, 1)\n", " quarter_list = ['0331', '0630', '0930', '1231']\n", " report_date_list = [str(t[0]) + t[1] for t in itertools.product(year_list, quarter_list)]\n", " \n", " config_df = pd.read_csv(indicator_config_fname)\n", " config_df['indicator_id'] = config_df['indicator_id'].astype('string')\n", " indicator_dict = config_df.set_index('indicator_id')['indicator_name'].to_dict()\n", " indicator_id_list = list(indicator_dict.keys())\n", " indicator_name_list = [\"'%s'\" % indicator_dict[indicator_id] for indicator_id in indicator_id_list]\n", " \n", " code = \"\"\"\n", " SetSysParam('ReportMode', -1);\n", " SetSysParam(pn_reportmode(), -1);\n", " SetSysParam(pn_stock(), '{stock_id}');\n", "\n", " date_array := Array({date_list_input});\n", " indicator_array := Array({indicator_id_list_input});\n", " indicator_name_array := Array({indicator_name_list_input});\n", " r := Array();\n", " \n", " for i:=0 to length(date_array)-1 do\n", " begin\n", " r[i]['StockID'] := 'stock_id';\n", " r[i]['报告期'] := date_array[i];\n", " for j:=0 to length(indicator_array)-1 do\n", " begin\n", " r[i][indicator_name_array[j]] := ReportOfAll(indicator_array[j], date_array[i]);\n", " end\n", " end\n", " return r;\n", " \"\"\".format(\n", " stock_id=stock_id, \n", " date_list_input=', '.join(report_date_list),\n", " indicator_id_list_input=', '.join(indicator_id_list),\n", " indicator_name_list_input=', '.join(indicator_name_list)\n", " )\n", " r = self.c.exec(code)\n", " r = r.value()\n", " df = pd.DataFrame(r, index=range(len(r)))\n", " df.set_index(['StockID', '报告期'], inplace=True)\n", " return df\n", " \n", "\n", " def get_stock_list(self, date, bk_name='A股'):\n", " code = \"\"\"\n", " bkName := \"%s\";\n", " endT := %d;\n", " return getAbkbydate(bkName,endT);\n", " \"\"\" % (bk_name, date)\n", " r = self.c.exec(code)\n", " \n", " return r.value()" ] }, { "cell_type": "code", "execution_count": 2, "id": "e11e4a42-1855-4602-95ec-d3ddc3f509e6", "metadata": {}, "outputs": [], "source": [ "with tsl() as t:\n", " #r = t.retrieve_stock_report(46, 'SZ000002', 2012)\n", " df = t.retrieve_stock_indicator('SZ000002', 2012, TINYSOFT_DATA_PATH + '/indicator-config/每股指标.csv')\n", " " ] }, { "cell_type": "code", "execution_count": 3, "id": "e2719d27-0e15-4b87-9e32-a2241365dcd6", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
每股营业收入(最新摊薄)每股营业收入每股息税前利润每股经营现金流(最新摊薄)每股公积金每股利润总额每股资本公积金每股负债每股收益(最新摊薄)每股短期负债...每股净资产增长率(%)每股净资产每股经营活动现金流量净额增长率(%)每股筹资现金流量净额每股现金及现金等价物每股收益增长率(%)每股现金净流量每股经营活动现金流量净额每股营业利润每股投资现金流量净额
StockID报告期
stock_id201203310.8899420.9409470.1970140.1101142.0487480.1871850.80741421.9473560.12007718.494247...19.3826844.943817164.8093740.3294180.00000015.8320560.4300570.1164250.185253-0.015415
201206302.6427512.7942160.5853500.2425032.0374210.5501190.79608723.6982470.32042719.745063...19.2519695.011256-26.3118890.9249930.00000025.0929111.1009900.2564020.546814-0.078620
201209303.9678884.1953010.802472-0.3002532.0302780.7426860.78894525.1140030.43696521.241522...20.1000365.122391-133.4225410.3685740.00000041.741473-0.134086-0.3174610.741498-0.183924
201212318.8699229.3782881.9806620.3205022.3374641.9163060.78978626.9811501.07963623.631523...20.4987935.8048519.9289391.4811464.64931830.4035851.5921580.3388711.911109-0.223138
201303311.2042531.2732330.245067-0.2050052.3494010.2178050.80177130.3093280.13882627.214376...20.6364965.964048-286.1688930.2668790.00000015.610817-0.014492-0.2167480.217828-0.063866
\n", "

5 rows × 27 columns

\n", "
" ], "text/plain": [ " 每股营业收入(最新摊薄) 每股营业收入 每股息税前利润 每股经营现金流(最新摊薄) 每股公积金 \\\n", "StockID 报告期 \n", "stock_id 20120331 0.889942 0.940947 0.197014 0.110114 2.048748 \n", " 20120630 2.642751 2.794216 0.585350 0.242503 2.037421 \n", " 20120930 3.967888 4.195301 0.802472 -0.300253 2.030278 \n", " 20121231 8.869922 9.378288 1.980662 0.320502 2.337464 \n", " 20130331 1.204253 1.273233 0.245067 -0.205005 2.349401 \n", "\n", " 每股利润总额 每股资本公积金 每股负债 每股收益(最新摊薄) 每股短期负债 ... \\\n", "StockID 报告期 ... \n", "stock_id 20120331 0.187185 0.807414 21.947356 0.120077 18.494247 ... \n", " 20120630 0.550119 0.796087 23.698247 0.320427 19.745063 ... \n", " 20120930 0.742686 0.788945 25.114003 0.436965 21.241522 ... \n", " 20121231 1.916306 0.789786 26.981150 1.079636 23.631523 ... \n", " 20130331 0.217805 0.801771 30.309328 0.138826 27.214376 ... \n", "\n", " 每股净资产增长率(%) 每股净资产 每股经营活动现金流量净额增长率(%) 每股筹资现金流量净额 \\\n", "StockID 报告期 \n", "stock_id 20120331 19.382684 4.943817 164.809374 0.329418 \n", " 20120630 19.251969 5.011256 -26.311889 0.924993 \n", " 20120930 20.100036 5.122391 -133.422541 0.368574 \n", " 20121231 20.498793 5.804851 9.928939 1.481146 \n", " 20130331 20.636496 5.964048 -286.168893 0.266879 \n", "\n", " 每股现金及现金等价物 每股收益增长率(%) 每股现金净流量 每股经营活动现金流量净额 每股营业利润 \\\n", "StockID 报告期 \n", "stock_id 20120331 0.000000 15.832056 0.430057 0.116425 0.185253 \n", " 20120630 0.000000 25.092911 1.100990 0.256402 0.546814 \n", " 20120930 0.000000 41.741473 -0.134086 -0.317461 0.741498 \n", " 20121231 4.649318 30.403585 1.592158 0.338871 1.911109 \n", " 20130331 0.000000 15.610817 -0.014492 -0.216748 0.217828 \n", "\n", " 每股投资现金流量净额 \n", "StockID 报告期 \n", "stock_id 20120331 -0.015415 \n", " 20120630 -0.078620 \n", " 20120930 -0.183924 \n", " 20121231 -0.223138 \n", " 20130331 -0.063866 \n", "\n", "[5 rows x 27 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 8, "id": "0f435014-7fc1-4514-ab44-ef6c3430e1ec", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['每股营业收入(最新摊薄)', '每股营业收入', '每股息税前利润', '每股经营现金流(最新摊薄)', '每股公积金', '每股利润总额',\n", " '每股资本公积金', '每股负债', '每股收益(最新摊薄)', '每股短期负债', '每股未分配利润', '每股收益', '每股股利',\n", " '每股净资产(最新摊薄)', '每股长期负债', '扣除非经常损益后的每股收益', '每股盈余公积金', '每股净资产增长率(%)',\n", " '每股净资产', '每股经营活动现金流量净额增长率(%)', '每股筹资现金流量净额', '每股现金及现金等价物', '每股收益增长率(%)',\n", " '每股现金净流量', '每股经营活动现金流量净额', '每股营业利润', '每股投资现金流量净额'],\n", " dtype='object')" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.columns" ] }, { "cell_type": "code", "execution_count": 5, "id": "fc39372e-5f8a-4043-8758-6102bd026ed8", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 75, "id": "13369644-5d79-4331-ab4c-582ff1e967dd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['indicator_id', 'indicator_name', 'indicator_function', 'indicator_comment']" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.read_csv('tinysoft-data/每股指标.csv')\n", "df.columns.tolist()" ] }, { "cell_type": "code", "execution_count": 77, "id": "a3d0b4f2-5ed5-4048-b1f4-6887c915c99b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "indicator_id int64\n", "indicator_name object\n", "indicator_function object\n", "indicator_comment object\n", "dtype: object" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.dtypes" ] }, { "cell_type": "code", "execution_count": 78, "id": "2b1dcf5e-820f-4db5-a609-75ac76602424", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'9900000': '每股收益',\n", " '9900001': '扣除非经常损益后的每股收益',\n", " '9900002': '每股收益增长率(%)',\n", " '9900003': '每股净资产',\n", " '9900004': '每股净资产增长率(%)',\n", " '9900005': '每股经营活动现金流量净额',\n", " '9900006': '每股经营活动现金流量净额增长率(%)',\n", " '9900007': '每股投资现金流量净额',\n", " '9900008': '每股筹资现金流量净额',\n", " '9900009': '每股现金及现金等价物',\n", " '9900010': '每股现金净流量',\n", " '9900011': '每股营业收入',\n", " '9900013': '每股营业利润',\n", " '9900014': '每股息税前利润',\n", " '9900015': '每股利润总额',\n", " '9900017': '每股盈余公积金',\n", " '9900018': '每股资本公积金',\n", " '9900019': '每股公积金',\n", " '9900020': '每股股利',\n", " '9900021': '每股未分配利润',\n", " '9900022': '每股短期负债',\n", " '9900023': '每股长期负债',\n", " '9900024': '每股负债',\n", " '9900025': '每股收益(最新摊薄)',\n", " '9900026': '每股净资产(最新摊薄)',\n", " '9900027': '每股营业收入(最新摊薄)',\n", " '9900028': '每股经营现金流(最新摊薄)'}" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['indicator_id'] = df['indicator_id'].astype('string')\n", "df.set_index('indicator_id')['indicator_name'].to_dict()" ] }, { "cell_type": "code", "execution_count": 79, "id": "156c2f94-95b0-4c6f-99d8-9e5260cecb4d", "metadata": {}, "outputs": [], "source": [ "indicator_dict = df.set_index('indicator_id')['indicator_name'].to_dict() \n", "indicator_id_list = list(indicator_dict.keys())\n", "indicator_name_list = [\"'%s'\" % indicator_dict[indicator_id] for indicator_id in indicator_id_list]" ] }, { "cell_type": "code", "execution_count": 80, "id": "1d938e71-fb9e-4d09-9684-bb5db80c96f0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'9900000, 9900001, 9900002, 9900003, 9900004, 9900005, 9900006, 9900007, 9900008, 9900009, 9900010, 9900011, 9900013, 9900014, 9900015, 9900017, 9900018, 9900019, 9900020, 9900021, 9900022, 9900023, 9900024, 9900025, 9900026, 9900027, 9900028'" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "', '.join(indicator_id_list)" ] }, { "cell_type": "code", "execution_count": 81, "id": "cede5b2d-87c6-4809-9262-95a3a18a5577", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"'每股收益', '扣除非经常损益后的每股收益', '每股收益增长率(%)', '每股净资产', '每股净资产增长率(%)', '每股经营活动现金流量净额', '每股经营活动现金流量净额增长率(%)', '每股投资现金流量净额', '每股筹资现金流量净额', '每股现金及现金等价物', '每股现金净流量', '每股营业收入', '每股营业利润', '每股息税前利润', '每股利润总额', '每股盈余公积金', '每股资本公积金', '每股公积金', '每股股利', '每股未分配利润', '每股短期负债', '每股长期负债', '每股负债', '每股收益(最新摊薄)', '每股净资产(最新摊薄)', '每股营业收入(最新摊薄)', '每股经营现金流(最新摊薄)'\"" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "', '.join(indicator_name_list)" ] }, { "cell_type": "code", "execution_count": 88, "id": "7d9b9940-9fda-4a3c-8b08-7f6d7cad4119", "metadata": {}, "outputs": [], "source": [ "year_list = range(2012, 2022, 1)\n", "quarter_list = ['0331', '0630', '0930', '1231']" ] }, { "cell_type": "code", "execution_count": 91, "id": "0055592f-d1db-4328-88ec-1dcbc938a2de", "metadata": {}, "outputs": [], "source": [ "import itertools\n", "\n", "report_date_list = [str(t[0]) + t[1] for t in itertools.product(year_list, quarter_list)]" ] }, { "cell_type": "code", "execution_count": 2, "id": "7937df2c-62b2-4c2e-8689-095744ceaaf9", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 6, "id": "2412ad25-8577-4a4c-84f4-ba7b02d5af15", "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv('./tinysoft-data/基础报表/40.业绩预测/SH600009.csv')" ] }, { "cell_type": "code", "execution_count": 7, "id": "37be2152-89bf-465c-ae70-625f714256c0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
StockIDStockName截止日公布日预警内容预警类型比上年同期增长数据来源预警详情备注盈利金额上限盈利金额单位盈利金额下限比上年同期增长下限(%)比上年同期增长上限(%)
0SH600009上海机场2020063020200429此次疫情对公司各项业务开展和客户经营影响较大,公司经营压力持续加大,营业收入预计将有较大幅度...预警公告中公布2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,国际机场协会和国际民航组织先后强调...NaN0.0NaN0.00.00000.0000
1SH600009上海机场2020093020200829预测年初至下一报告期期末的累计净利润可能为亏损预警公告中公布2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,国际机场协会和国际民航组织\\r\\n...NaN0.0NaN0.00.00000.0000
2SH600009上海机场2020123120201031,营业收入预计将有较大幅度下降预减公告中公布2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,国际机场协会和国际民航组织先后强调...NaN0.0NaN0.00.00000.0000
3SH600009上海机场2020123120210130净利润亏损121000万元-129000万元预亏天软计算2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,\\r\\n行业受疫情影响严重、所面临...NaN-121000.0万元-129000.0-125.6451-124.0547
4SH600009上海机场2021063020210429预计业绩仍将亏损预警公告中公布当前,疫情仍是影响行业恢复发展的最大不确定性因素,境外疫情形势依然严峻复杂,本土疫情呈零星散...NaN0.0NaN0.00.00000.0000
\n", "
" ], "text/plain": [ " StockID StockName 截止日 公布日 \\\n", "0 SH600009 上海机场 20200630 20200429 \n", "1 SH600009 上海机场 20200930 20200829 \n", "2 SH600009 上海机场 20201231 20201031 \n", "3 SH600009 上海机场 20201231 20210130 \n", "4 SH600009 上海机场 20210630 20210429 \n", "\n", " 预警内容 预警类型 比上年同期增长数据来源 \\\n", "0 此次疫情对公司各项业务开展和客户经营影响较大,公司经营压力持续加大,营业收入预计将有较大幅度... 预警 公告中公布 \n", "1 预测年初至下一报告期期末的累计净利润可能为亏损 预警 公告中公布 \n", "2 ,营业收入预计将有较大幅度下降 预减 公告中公布 \n", "3 净利润亏损121000万元-129000万元 预亏 天软计算 \n", "4 预计业绩仍将亏损 预警 公告中公布 \n", "\n", " 预警详情 备注 盈利金额上限 盈利金额单位 \\\n", "0 2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,国际机场协会和国际民航组织先后强调... NaN 0.0 NaN \n", "1 2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,国际机场协会和国际民航组织\\r\\n... NaN 0.0 NaN \n", "2 2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,国际机场协会和国际民航组织先后强调... NaN 0.0 NaN \n", "3 2020年以来,全球航空业因新冠肺炎疫情爆发面临严峻挑战,\\r\\n行业受疫情影响严重、所面临... NaN -121000.0 万元 \n", "4 当前,疫情仍是影响行业恢复发展的最大不确定性因素,境外疫情形势依然严峻复杂,本土疫情呈零星散... NaN 0.0 NaN \n", "\n", " 盈利金额下限 比上年同期增长下限(%) 比上年同期增长上限(%) \n", "0 0.0 0.0000 0.0000 \n", "1 0.0 0.0000 0.0000 \n", "2 0.0 0.0000 0.0000 \n", "3 -129000.0 -125.6451 -124.0547 \n", "4 0.0 0.0000 0.0000 " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()['']" ] }, { "cell_type": "code", "execution_count": 4, "id": "45fc86a4-aeda-401f-9fdd-30732e195a3f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['StockID', 'StockName', '截止日', '公布日', '营业总收入', '每股净资产', '归属母公司股东权益合计',\n", " '营业利润', '股本', '资产总计', '利润总额', '净资产收益率(加权)(%)', '基本每股收益',\n", " '归属于母公司所有者净利润'],\n", " dtype='object')" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.columns" ] }, { "cell_type": "code", "execution_count": 22, "id": "25a034a6-495c-4f10-b800-3f34fd7881cd", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
报告期20200630202009302020123120210331202106302021093020211231
净资产收益率(%)3.8924646.2429807.9443942.7191464.6615397.4924529.188566
销售净利率(%)17.46246619.21519518.84044824.24619520.76405322.90667521.451976
销售毛利率(%)22.54493924.81297824.03837430.93950426.47024128.95589327.148533
\n", "
" ], "text/plain": [ "报告期 20200630 20200930 20201231 20210331 20210630 20210930 \\\n", "净资产收益率(%) 3.892464 6.242980 7.944394 2.719146 4.661539 7.492452 \n", "销售净利率(%) 17.462466 19.215195 18.840448 24.246195 20.764053 22.906675 \n", "销售毛利率(%) 22.544939 24.812978 24.038374 30.939504 26.470241 28.955893 \n", "\n", "报告期 20211231 \n", "净资产收益率(%) 9.188566 \n", "销售净利率(%) 21.451976 \n", "销售毛利率(%) 27.148533 " ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.set_index('报告期')[['净资产收益率(%)', '销售净利率(%)', '销售毛利率(%)']].tail(7).T" ] }, { "cell_type": "code", "execution_count": null, "id": "9e2a7737-f6a2-4990-8f98-e31cfa7ae9e1", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.13" } }, "nbformat": 4, "nbformat_minor": 5 }