20241008
This commit is contained in:
1 parent
e0bfb443be
commit
47bc01514d
2 files changed
+324
-85
No files matched your search
+289
-50
@@ -3,7 +3,9 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b6ce4321-f82a-4d9d-a110-44a23b95970b",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"source": [
|
||||
"# 2023年体质检测"
|
||||
]
|
||||
@@ -817,27 +819,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 70,
|
||||
"execution_count": null,
|
||||
"id": "7b148f6d-0d6d-4573-9df3-ea02faab165d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-15T12:32:09.317495Z",
|
||||
"iopub.status.busy": "2023-04-15T12:32:09.316589Z",
|
||||
"iopub.status.idle": "2023-04-15T12:32:09.333606Z",
|
||||
"shell.execute_reply": "2023-04-15T12:32:09.332528Z",
|
||||
"shell.execute_reply.started": "2023-04-15T12:32:09.317454Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[['张东红', '建筑设计所'], ['孙淑华', '建筑设计所'], ['靳永东', '建筑设计所'], ['张浩', '建筑设计所'], ['宁聪聪', '建筑设计所'], ['李磊', '建筑设计所'], ['尚华凯', '建筑设计所'], ['王修龙', '建筑设计所'], ['王剑', '建筑设计所'], ['李天萌', '建筑设计所'], ['崔华强', '建筑设计所'], ['王乙臻', '建筑设计所'], ['刘小燕', '建筑设计所'], ['韦盛', '建筑设计所'], ['张跃', '建筑设计所']]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from jmespath import search\n",
|
||||
"filename = 'data/result_东营石油工程设计院(new).json'\n",
|
||||
@@ -866,15 +853,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": 26,
|
||||
"id": "096e2b97-b83c-46bb-a070-c816e47da331",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-09-26T08:13:44.536115Z",
|
||||
"iopub.status.busy": "2024-09-26T08:13:44.535333Z",
|
||||
"iopub.status.idle": "2024-09-26T08:13:44.828454Z",
|
||||
"shell.execute_reply": "2024-09-26T08:13:44.827938Z",
|
||||
"shell.execute_reply.started": "2024-09-26T08:13:44.536043Z"
|
||||
"iopub.execute_input": "2024-10-08T11:24:04.312970Z",
|
||||
"iopub.status.busy": "2024-10-08T11:24:04.312362Z",
|
||||
"iopub.status.idle": "2024-10-08T11:24:04.343448Z",
|
||||
"shell.execute_reply": "2024-10-08T11:24:04.342837Z",
|
||||
"shell.execute_reply.started": "2024-10-08T11:24:04.312912Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -904,13 +891,13 @@
|
||||
" dict1['name'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 4).value\n",
|
||||
" dict1['unit'] = sheet.cell(n, 2).value\n",
|
||||
" if sheet.cell(n, 5).value is not None:\n",
|
||||
" if sheet.cell(n, 7).value is not None:\n",
|
||||
" dict1['gh'] = sheet.cell(n, 7).value\n",
|
||||
" #dict1['birth'] = str(sheet.cell(n, 6).value).replace('/','-').split(' ')[0] \n",
|
||||
" if sheet.cell(n, 4).value is not None:\n",
|
||||
" if sheet.cell(n, 6).value is not None:\n",
|
||||
" dict1['phone'] = str(sheet.cell(n,6).value)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0] \n",
|
||||
" #dict1['gh'] = str(sheet.cell(n, 7).value)\n",
|
||||
" person[code] = dict1\n",
|
||||
"filename = 'data/东营工程设计院2024.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
@@ -928,27 +915,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"id": "28afeee6-43c0-4e96-b3aa-dc09c6288425",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-09-26T08:18:32.261817Z",
|
||||
"iopub.status.busy": "2024-09-26T08:18:32.261244Z",
|
||||
"iopub.status.idle": "2024-09-26T08:18:32.276332Z",
|
||||
"shell.execute_reply": "2024-09-26T08:18:32.275838Z",
|
||||
"shell.execute_reply.started": "2024-09-26T08:18:32.261764Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"75\n",
|
||||
"75\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -982,7 +952,10 @@
|
||||
" m_item = str(result[3]) \n",
|
||||
" re_ta.setdefault(user,{}) \n",
|
||||
" re_ta[user]['name'] = dict1[user]['name']\n",
|
||||
" #re_ta[user]['sex'] = dict1[user]['sex'] \n",
|
||||
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
|
||||
" re_ta[user]['birth'] = dict1[user]['birth'] \n",
|
||||
" re_ta[user]['phone'] = dict1[user]['phone'] \n",
|
||||
" re_ta[user]['gh'] = dict1[user]['gh'] \n",
|
||||
" re_ta[user]['unit'] = dict1[user]['unit']\n",
|
||||
" #re_ta[user]['sub_unit'] = dict1[user]['sub_unit']\n",
|
||||
" item_name = item[m_item]['name']\n",
|
||||
@@ -997,10 +970,276 @@
|
||||
"print(len(re_ta))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "78fd57de-eff7-487c-a483-3cf606127f58",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 导入问卷信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"id": "808e65e9-a9e3-44ea-9c0b-359375dceb3d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-08T11:25:26.759557Z",
|
||||
"iopub.status.busy": "2024-10-08T11:25:26.758847Z",
|
||||
"iopub.status.idle": "2024-10-08T11:25:26.779018Z",
|
||||
"shell.execute_reply": "2024-10-08T11:25:26.778247Z",
|
||||
"shell.execute_reply.started": "2024-10-08T11:25:26.759489Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"filename = 'data/result_东营工程设计院2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/东营工程设计院2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone = {}\n",
|
||||
"for k,v in dict3.items():\n",
|
||||
" if 'phone' in v.keys():\n",
|
||||
" phone[v['phone']] = k\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241008.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
" for line in fl:\n",
|
||||
" list1.append(line)\n",
|
||||
"#print(list1)\n",
|
||||
"dict2 = {}\n",
|
||||
"psy =[]\n",
|
||||
"tcm = []\n",
|
||||
"spine = []\n",
|
||||
"\n",
|
||||
"for i in range(0,60):\n",
|
||||
" tcm.append(0)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"for item in list1:\n",
|
||||
" if item[2] in phone.keys(): \n",
|
||||
" tcm = [] \n",
|
||||
" for i in range(0,60):\n",
|
||||
" tcm.append(0)\n",
|
||||
" content = json.loads(item[5])\n",
|
||||
" rq = date.fromisoformat(item[6].replace('/','-').split(' ')[0])\n",
|
||||
" if phone[item[2]] not in dict1.keys():\n",
|
||||
" dict1[phone[item[2]]] = dict3[phone[item[2]]]\n",
|
||||
" \n",
|
||||
" #dict1[phone[item[2]]]['rq'] = date.fromisoformat(item[6].replace('/','-').split(' ')[0])\n",
|
||||
" for k, v in content.items(): \n",
|
||||
" if 'tcm' in k:\n",
|
||||
" i = int(k[3:])\n",
|
||||
" tcm[i-1] = int(v)\n",
|
||||
" \n",
|
||||
" if 'tcm' in item[5]:\n",
|
||||
" dict1[phone[item[2]]]['tcm'] = tcm\n",
|
||||
" birth = date.fromisoformat(dict3[phone[item[2]]]['birth'].replace('/','-'))\n",
|
||||
" \n",
|
||||
" days = (rq-birth).days \n",
|
||||
" dict1[phone[item[2]]]['age'] = int(days/365)\n",
|
||||
" dict1[phone[item[2]]]['month'] = int(days/365*12)\n",
|
||||
"filename = 'data/result_东营工程设计院2024_all.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "24b51e8b-a16b-47ac-85a1-b7037e7ce223",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计未参加问卷人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"id": "47f53bdf-ac6a-44f1-9f5f-852eb2d61127",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-08T11:28:23.464329Z",
|
||||
"iopub.status.busy": "2024-10-08T11:28:23.462858Z",
|
||||
"iopub.status.idle": "2024-10-08T11:28:23.485822Z",
|
||||
"shell.execute_reply": "2024-10-08T11:28:23.485366Z",
|
||||
"shell.execute_reply.started": "2024-10-08T11:28:23.464250Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"13864709221\n",
|
||||
"15542678894\n",
|
||||
"13963385888\n",
|
||||
"18562090935\n",
|
||||
"16688150490\n",
|
||||
"13181954355\n",
|
||||
"13156800727\n",
|
||||
"18661371563\n",
|
||||
"15954633893\n",
|
||||
"13864703202\n",
|
||||
"13381366350\n",
|
||||
"16688169676\n",
|
||||
"13615461331\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"filename = 'data/result_东营工程设计院2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/东营工程设计院2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone = {}\n",
|
||||
"for k,v in dict3.items():\n",
|
||||
" if 'phone' in v.keys():\n",
|
||||
" phone[v['phone']] = k\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241008.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
" for line in fl:\n",
|
||||
" list1.append(line)\n",
|
||||
"#print(list1)\n",
|
||||
"dict2 = {}\n",
|
||||
"tcm = []\n",
|
||||
"for item in list1:\n",
|
||||
" if item[2] in phone.keys(): \n",
|
||||
" tcm = [] \n",
|
||||
" for i in range(0,60):\n",
|
||||
" tcm.append(0)\n",
|
||||
" content = json.loads(item[5])\n",
|
||||
" rq = date.fromisoformat(item[6].replace('/','-').split(' ')[0])\n",
|
||||
" if phone[item[2]] not in dict1.keys():\n",
|
||||
" dict1[phone[item[2]]] = dict3[phone[item[2]]]\n",
|
||||
" \n",
|
||||
" #dict1[phone[item[2]]]['rq'] = date.fromisoformat(item[6].replace('/','-').split(' ')[0])\n",
|
||||
" for k, v in content.items(): \n",
|
||||
" if 'tcm' in k:\n",
|
||||
" i = int(k[3:])\n",
|
||||
" tcm[i-1] = int(v)\n",
|
||||
" \n",
|
||||
" if 'tcm' in item[5]:\n",
|
||||
" dict1[phone[item[2]]]['tcm'] = tcm\n",
|
||||
" birth = date.fromisoformat(dict3[phone[item[2]]]['birth'].replace('/','-'))\n",
|
||||
" \n",
|
||||
" days = (rq-birth).days \n",
|
||||
" dict1[phone[item[2]]]['age'] = int(days/365)\n",
|
||||
" dict1[phone[item[2]]]['month'] = int(days/365*12)\n",
|
||||
" else:\n",
|
||||
" print(item[2])\n",
|
||||
"filename = 'data/result_东营工程设计院2024_all.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "cef2ced9-2cd1-4632-8fe6-6a5a57e2fcb3",
|
||||
"id": "c633a37c-0f0e-4b81-83cb-a9fa49efbe36",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"filename = 'data/result_东营工程设计院2024_all.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"i = 1\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" if 'tcm' not in v.keys():\n",
|
||||
" print(i,k,v['name'])\n",
|
||||
" i+=1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"id": "3f68bad7-e2ba-47e1-9ae0-08fce2ad79d1",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-08T11:20:59.790384Z",
|
||||
"iopub.status.busy": "2024-10-08T11:20:59.789696Z",
|
||||
"iopub.status.idle": "2024-10-08T11:20:59.798731Z",
|
||||
"shell.execute_reply": "2024-10-08T11:20:59.797943Z",
|
||||
"shell.execute_reply.started": "2024-10-08T11:20:59.790320Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"162\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"filename = 'data/result_东营工程设计院2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/东营工程设计院2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone = {}\n",
|
||||
"for k,v in dict3.items():\n",
|
||||
" if 'phone' in v.keys():\n",
|
||||
" phone[v['phone']] = k\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241008.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
" for line in fl:\n",
|
||||
" list1.append(line)\n",
|
||||
"for item in list1:\n",
|
||||
" if item[2] in phone.keys() and phone[item[2]] not in dict1.keys(): \n",
|
||||
" print(phone[item[2]])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "696682cf-54c0-46d5-9947-d2bee794f555",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
Reference in new issue
Block a user