This commit is contained in:
512song committed 2021-12-16 09:03:34 +08:00
1 parent aa4beacfa9
commit 354e0e0438
1 file changed
+116 -64
+116 -64
View File
@@ -252,7 +252,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"### 穴位数据导入数据库中"
]
@@ -288,7 +290,7 @@
" dict1.setdefault('about',{})\n",
" for s in list3:\n",
" item = s.strip().split(':')\n",
" dict1['about'][item[0]] = item[1]\n",
" dict1['about'][item[0].strip()] = item[1].strip()\n",
" dict1.setdefault('content',{})\n",
" for k, v in dict2.items():\n",
" dict1['content'][k] = v \n",
@@ -300,7 +302,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 中医症状数据导入数据库中"
]
@@ -346,7 +351,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 疾病数据导入数据库中"
]
@@ -392,7 +400,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 术语数据导入数据库中"
]
@@ -445,7 +456,9 @@
"iopub.status.idle": "2021-12-15T10:01:32.921185Z",
"shell.execute_reply": "2021-12-15T10:01:32.921185Z",
"shell.execute_reply.started": "2021-12-15T10:01:32.917184Z"
}
},
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 西医症状数据导入数据库中"
@@ -492,32 +505,19 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 药剂数据导入数据库中"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-15T10:13:01.097292Z",
"iopub.status.busy": "2021-12-15T10:13:01.097292Z",
"iopub.status.idle": "2021-12-15T10:13:04.127788Z",
"shell.execute_reply": "2021-12-15T10:13:04.127788Z",
"shell.execute_reply.started": "2021-12-15T10:13:01.097292Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok!\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import re\n",
@@ -555,32 +555,21 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 药膳数据导入数据库中"
]
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-15T10:15:38.181411Z",
"iopub.status.busy": "2021-12-15T10:15:38.181411Z",
"iopub.status.idle": "2021-12-15T10:15:38.468083Z",
"shell.execute_reply": "2021-12-15T10:15:38.467083Z",
"shell.execute_reply.started": "2021-12-15T10:15:38.181411Z"
}
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok!\n"
]
}
],
"outputs": [],
"source": [
"import json\n",
"import re\n",
@@ -617,32 +606,19 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"### 中草药数据导入数据库中"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-15T10:17:41.510430Z",
"iopub.status.busy": "2021-12-15T10:17:41.510430Z",
"iopub.status.idle": "2021-12-15T10:17:44.974610Z",
"shell.execute_reply": "2021-12-15T10:17:44.973618Z",
"shell.execute_reply.started": "2021-12-15T10:17:41.510430Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok!\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import re\n",
@@ -678,6 +654,82 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 穴位隶属整理"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"execution": {
"iopub.execute_input": "2021-12-16T00:57:08.586442Z",
"iopub.status.busy": "2021-12-16T00:57:08.585443Z",
"iopub.status.idle": "2021-12-16T00:57:08.662953Z",
"shell.execute_reply": "2021-12-16T00:57:08.662953Z",
"shell.execute_reply.started": "2021-12-16T00:57:08.586442Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"耳穴\n",
"手针穴\n",
"经外奇穴\n",
"任脉\n",
"足太阳膀胱经\n",
"足少阳胆经\n",
"手少阳三焦经\n",
"手太阳小肠经\n",
"足阳明胃经\n",
"手太阴肺经\n",
"手阳明大肠经\n",
"足太阴脾经\n",
"手少阴心经\n",
"足少阴肾经\n",
"手厥阴心包经\n",
"督脉\n",
"足厥阴肝经\n",
"推拿穴位\n",
"头针刺激区\n",
"组合穴\n",
"手穴\n"
]
}
],
"source": [
"import json\n",
"import re\n",
"import pymongo\n",
"\n",
"myclient = pymongo.MongoClient('mongodb://192.168.3.100:27017/')\n",
"mydb = myclient['dayi']\n",
"mycol = mydb[\"xuewei\"]\n",
"dict1 = {}\n",
"list1 = []\n",
"for x in mycol.find({},{ \"_id\": 0,\"name\":1,\"about.隶属\":1 }):\n",
" if 'about' in x.keys():\n",
" m_ls = x['about']['隶属']\n",
" dict1.setdefault(m_ls,[])\n",
" dict1[m_ls].append(x['name'])\n",
"'''\n",
"filename = './file/穴位隶属.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl) \n",
"'''\n",
"for item in dict1.keys():\n",
" print(item)"
]
},
{
"cell_type": "markdown",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"## 穴位数据导出Excel表"
]