20220622
This commit is contained in:
1 parent
c7c2fb4208
commit
8fabf3c379
1 file changed
+69
-10
+69
-10
@@ -1002,16 +1002,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 80,
|
||||
"execution_count": null,
|
||||
"id": "a7cf5e57-a381-4911-96ff-1e1469b6f9bc",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-04-30T13:33:40.348110Z",
|
||||
"iopub.status.busy": "2022-04-30T13:33:40.346875Z",
|
||||
"iopub.status.idle": "2022-04-30T13:33:44.806237Z",
|
||||
"shell.execute_reply": "2022-04-30T13:33:44.804223Z",
|
||||
"shell.execute_reply.started": "2022-04-30T13:33:40.347998Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -1533,8 +1526,7 @@
|
||||
"cell_type": "markdown",
|
||||
"id": "3711130b-59e3-4844-ac31-234ba77cd46c",
|
||||
"metadata": {
|
||||
"tags": [],
|
||||
"toc-hr-collapsed": true
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## 脊柱症状统计"
|
||||
@@ -2180,6 +2172,73 @@
|
||||
"wb.save('test3.xlsx')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b5c85c50-11cc-4678-b244-ee9022fa6d54",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 分症状统计"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"id": "c288cfba-ff44-4cb2-8a77-78ecc45dcb41",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-06-22T09:12:51.227405Z",
|
||||
"iopub.status.busy": "2022-06-22T09:12:51.226182Z",
|
||||
"iopub.status.idle": "2022-06-22T09:12:51.354977Z",
|
||||
"shell.execute_reply": "2022-06-22T09:12:51.353040Z",
|
||||
"shell.execute_reply.started": "2022-06-22T09:12:51.227296Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"import os,sys,shutil\n",
|
||||
"\n",
|
||||
"## 导入脊椎症状对照表\n",
|
||||
"\n",
|
||||
"filename = '北海炼化人员名单.json'\n",
|
||||
"renyuan = []\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"zz = '失眠'\n",
|
||||
"filename = '脊柱症状自我诊断表统计.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"\n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" if zz in v['症状']:\n",
|
||||
" mdm = str(k).rjust(5,'0')\n",
|
||||
" renyuan.append([mdm,dict1[mdm]['name'],dict1[mdm]['sex'],dict1[mdm]['unit']])\n",
|
||||
"\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"i = 1\n",
|
||||
"\n",
|
||||
"sheet[f'A{i}'] = '编号'\n",
|
||||
"sheet[f'B{i}'] = '姓名'\n",
|
||||
"sheet[f'C{i}'] = '性别'\n",
|
||||
"sheet[f'D{i}'] = '部门'\n",
|
||||
"i +=1\n",
|
||||
"\n",
|
||||
"for item in renyuan:\n",
|
||||
" sheet[f'A{i}'] = item[0]\n",
|
||||
" sheet[f'B{i}'] = item[1]\n",
|
||||
" sheet[f'C{i}'] = item[2]\n",
|
||||
" sheet[f'D{i}'] = item[3]\n",
|
||||
" \n",
|
||||
" i +=1\n",
|
||||
"\n",
|
||||
"wb.save('file/失眠人员.xlsx')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
||||
Reference in new issue
Block a user