This commit is contained in:
512song@sina.com committed 2022-06-30 10:23:03 +08:00
1 parent 1adfe9cc3d
commit fcc72be637
1 file changed
+147 -31
+147 -31
View File
@@ -4,7 +4,14 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 正则表达式分割文本" "## 基础知识"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 正则表达式分割文本"
] ]
}, },
{ {
@@ -70,11 +77,18 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true, "tags": [],
"tags": [] "toc-hr-collapsed": true
}, },
"source": [ "source": [
"## 药膳归经明细文件生成" "## 医药体测"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 药膳归经明细文件生成"
] ]
}, },
{ {
@@ -116,11 +130,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 药膳归经权重生成" "### 药膳归经权重生成"
] ]
}, },
{ {
@@ -197,11 +210,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"tags": [], "tags": []
"toc-hr-collapsed": true
}, },
"source": [ "source": [
"## 穴位数据导入" "### 穴位数据导入"
] ]
}, },
{ {
@@ -210,7 +222,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 简单导出简介、内容" "#### 简单导出简介、内容"
] ]
}, },
{ {
@@ -245,11 +257,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 数据导入文件中" "#### 数据导入文件中"
] ]
}, },
{ {
@@ -288,11 +299,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 穴位数据导入数据库中" "#### 穴位数据导入数据库中"
] ]
}, },
{ {
@@ -339,11 +349,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 中医症状数据导入数据库中" "#### 中医症状数据导入数据库中"
] ]
}, },
{ {
@@ -392,7 +401,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 疾病数据导入数据库中" "#### 疾病数据导入数据库中"
] ]
}, },
{ {
@@ -441,7 +450,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 术语数据导入数据库中" "#### 术语数据导入数据库中"
] ]
}, },
{ {
@@ -497,7 +506,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 西医症状数据导入数据库中" "#### 西医症状数据导入数据库中"
] ]
}, },
{ {
@@ -546,7 +555,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 药剂数据导入数据库中" "#### 药剂数据导入数据库中"
] ]
}, },
{ {
@@ -596,7 +605,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 药膳数据导入数据库中" "#### 药膳数据导入数据库中"
] ]
}, },
{ {
@@ -647,7 +656,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"### 中草药数据导入数据库中" "#### 中草药数据导入数据库中"
] ]
}, },
{ {
@@ -694,7 +703,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 穴位隶属整理" "### 穴位隶属整理"
] ]
}, },
{ {
@@ -734,7 +743,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 穴位功能、主治统计" "### 穴位功能、主治统计"
] ]
}, },
{ {
@@ -789,7 +798,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 穴位数据导出Excel表" "### 穴位数据导出Excel表"
] ]
}, },
{ {
@@ -839,7 +848,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 术语数据处理" "### 术语数据处理"
] ]
}, },
{ {
@@ -878,7 +887,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 疾病数据处理" "### 疾病数据处理"
] ]
}, },
{ {
@@ -914,7 +923,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 中草药数据处理" "### 中草药数据处理"
] ]
}, },
{ {
@@ -969,7 +978,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 药剂数据处理" "### 药剂数据处理"
] ]
}, },
{ {
@@ -1016,7 +1025,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 药膳数据处理" "### 药膳数据处理"
] ]
}, },
{ {
@@ -1070,7 +1079,7 @@
"tags": [] "tags": []
}, },
"source": [ "source": [
"## 北海炼化体检数据提取" "### 北海炼化体检数据提取"
] ]
}, },
{ {
@@ -1204,6 +1213,113 @@
"collist = mydb. list_collection_names()\n", "collist = mydb. list_collection_names()\n",
"print(collist)" "print(collist)"
] ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 图表生成"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 高考一分一段表生成"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"execution": {
"iopub.execute_input": "2022-06-30T01:50:36.294943Z",
"iopub.status.busy": "2022-06-30T01:50:36.294429Z",
"iopub.status.idle": "2022-06-30T01:50:36.316866Z",
"shell.execute_reply": "2022-06-30T01:50:36.315497Z",
"shell.execute_reply.started": "2022-06-30T01:50:36.294897Z"
},
"tags": []
},
"outputs": [],
"source": [
"from pyecharts.globals import CurrentConfig, NotebookType\n",
"CurrentConfig.NOTEBOOK_TYPE = NotebookType.JUPYTER_LAB\n",
"from pyecharts import options as opts\n",
"from pyecharts.charts import Bar,Line\n",
"import pyecharts.options as opts\n",
"from pyecharts.faker import Faker\n",
"import json\n",
"\n",
"list_x = []\n",
"list_y = []\n",
"filename = 'data/17-21年一分一段表.json'\n",
"with open(filename,'r') as fl:\n",
" m_xx = json.load(fl)\n",
"dict1 =m_xx['2020']['z']\n",
"for i in sorted(dict1,reverse=True): #降序\n",
" list_x.append(i)\n",
" list_y.append(dict1[i]['num_person'])\n",
" #print(i,dict1[i]['num_person'])\n",
"bar = (\n",
" Bar()\n",
" .add_xaxis(list_x)\n",
" .add_yaxis(\"2020年一分一段表\", list_y, category_gap=0, color=Faker.rand_color())\n",
" .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
" .set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-直方图\"))\n",
" .render(\"bar_histogram2020.html\")\n",
"# .set_global_opts(title_opts=opts.TitleOpts(title=\"运动步幅及步频\", subtitle=\"户外运动\"),)\n",
")\n",
"#bar.load_javascript()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bar.render_notebook()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pyecharts.globals import CurrentConfig, NotebookType\n",
"CurrentConfig.NOTEBOOK_TYPE = NotebookType.JUPYTER_LAB\n",
"from pyecharts import options as opts\n",
"from pyecharts.charts import Bar,Line\n",
"import pyecharts.options as opts\n",
"from pyecharts.faker import Faker\n",
"import json\n",
"\n",
"x_2021 = []\n",
"y_2021 = []\n",
"x_2020 = []\n",
"y_2020 = []\n",
"filename = 'data/17-21年一分一段表.json'\n",
"with open(filename,'r') as fl:\n",
" m_xx = json.load(fl)\n",
"dict1 =m_xx['2021']['z']\n",
"for i in sorted(dict1,reverse=True): #降序\n",
" x_2021.append(i)\n",
" y_2021.append(dict1[i]['num_person'])\n",
"dict1 =m_xx['2020']['z']\n",
"for i in sorted(dict1,reverse=True): #降序\n",
" x_2021.append(i)\n",
" y_2021.append(dict1[i]['num_person'])\n",
" #print(i,dict1[i]['num_person'])\n",
"bar = (\n",
" Bar()\n",
" .add_xaxis(list_x)\n",
" .add_yaxis(\"人数\", list_y, category_gap=0, color=Faker.rand_color())\n",
" .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
" .set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-直方图\"))\n",
" .render(\"bar_histogram.html\")\n"
]
} }
], ],
"metadata": { "metadata": {