20230506
This commit is contained in:
1 parent
89ae72f87e
commit
3c8e9c5157
8 files changed
+728
-191
No files matched your search
+136
-70
@@ -72,15 +72,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 10,
|
||||
"id": "d0cb294b-d403-4c4c-9de6-61ec98cf9797",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-15T14:31:21.405573Z",
|
||||
"iopub.status.busy": "2023-04-15T14:31:21.404701Z",
|
||||
"iopub.status.idle": "2023-04-15T14:31:21.431005Z",
|
||||
"shell.execute_reply": "2023-04-15T14:31:21.429944Z",
|
||||
"shell.execute_reply.started": "2023-04-15T14:31:21.405535Z"
|
||||
"iopub.execute_input": "2023-05-05T06:41:07.266525Z",
|
||||
"iopub.status.busy": "2023-05-05T06:41:07.266100Z",
|
||||
"iopub.status.idle": "2023-05-05T06:41:07.287905Z",
|
||||
"shell.execute_reply": "2023-05-05T06:41:07.286990Z",
|
||||
"shell.execute_reply.started": "2023-05-05T06:41:07.266497Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -121,36 +121,44 @@
|
||||
" list1.append(line)\n",
|
||||
"#print(list1)\n",
|
||||
"for result in list1:\n",
|
||||
" user = str(result[4])\n",
|
||||
" user = str(result[2])\n",
|
||||
" if user in dict1.keys():\n",
|
||||
" \n",
|
||||
" m_item = str(result[0]) \n",
|
||||
" 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]['unit'] = dict1[user]['unit'] \n",
|
||||
" item_name = item[m_item]['name']\n",
|
||||
" re_ta[user].setdefault(item_name,{}) \n",
|
||||
" score = int(result[1])/item[m_item]['divisor'] \n",
|
||||
" score = int(result[4])/item[m_item]['divisor'] \n",
|
||||
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
|
||||
" re_ta[user][item_name]['得分'] =result[2]\n",
|
||||
"filename = 'data/result_上地派出所.json'\n",
|
||||
" re_ta[user][item_name]['得分'] =result[5]\n",
|
||||
"filename = 'data/result_上地派出所1.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl) \n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ac363a21-83aa-42e5-a82b-fd051e4b86a7",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 计算测试成绩平均分"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"id": "78e461ac-1074-4bce-a2a5-4cd60f3b7ae2",
|
||||
"execution_count": 19,
|
||||
"id": "4f5a8416-3536-4c52-bfdc-758420e519d3",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-15T14:36:06.348606Z",
|
||||
"iopub.status.busy": "2023-04-15T14:36:06.348205Z",
|
||||
"iopub.status.idle": "2023-04-15T14:36:06.363398Z",
|
||||
"shell.execute_reply": "2023-04-15T14:36:06.362284Z",
|
||||
"shell.execute_reply.started": "2023-04-15T14:36:06.348579Z"
|
||||
"iopub.execute_input": "2023-05-05T07:17:09.764428Z",
|
||||
"iopub.status.busy": "2023-05-05T07:17:09.763611Z",
|
||||
"iopub.status.idle": "2023-05-05T07:17:09.782569Z",
|
||||
"shell.execute_reply": "2023-05-05T07:17:09.781678Z",
|
||||
"shell.execute_reply.started": "2023-05-05T07:17:09.764387Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -159,52 +167,37 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"44\n"
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"filename = '../item.json'\n",
|
||||
"item = {}\n",
|
||||
"unit = {}\n",
|
||||
"items = ['体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位/部门','身高','','体重','','肺活量','','握力','','坐位体前屈','','纵跳','','俯卧撑','','一分钟仰卧起坐','','单脚站立','','选择反应时','','台阶指数']\n",
|
||||
"filename = 'data/result_上地派出所1.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" item[k] = v\n",
|
||||
"filename = 'data/上地派出所人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"re_ta = {}\n",
|
||||
"dict2 = {}\n",
|
||||
"list1 = []\n",
|
||||
"#print(\"\\n运动项目信息:\")\n",
|
||||
"filename = 'data/142.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",
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" list1.append(line)\n",
|
||||
"#print(list1)\n",
|
||||
"for result in list1:\n",
|
||||
" user = str(result[4])\n",
|
||||
" if user in dict1.keys():\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" i = 0\n",
|
||||
" score = 0\n",
|
||||
" for k1, v1 in v.items():\n",
|
||||
" \n",
|
||||
" m_item = str(result[0]) \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]['unit'] = dict1[user]['unit'] \n",
|
||||
" item_name = item[m_item]['name']\n",
|
||||
" re_ta[user].setdefault(item_name,{}) \n",
|
||||
" score = int(result[1])/item[m_item]['divisor'] \n",
|
||||
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
|
||||
" re_ta[user][item_name]['得分'] =result[2]\n",
|
||||
"print(len(re_ta))"
|
||||
" if k1 in items:\n",
|
||||
" score = score + int(v1['得分'])\n",
|
||||
" i = i + 1\n",
|
||||
" pjf = score / i\n",
|
||||
" dict1[k]['总分'] = score\n",
|
||||
" dict1[k]['平均分'] = round(score / i,2)\n",
|
||||
"filename = 'data/result_上地派出所.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl) \n",
|
||||
"print('ok')\n",
|
||||
" \n",
|
||||
" "
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -217,15 +210,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 22,
|
||||
"id": "eafc36e7-6a8d-4744-b5ff-9cc0c624c732",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-15T14:33:22.621334Z",
|
||||
"iopub.status.busy": "2023-04-15T14:33:22.620509Z",
|
||||
"iopub.status.idle": "2023-04-15T14:33:22.666051Z",
|
||||
"shell.execute_reply": "2023-04-15T14:33:22.665054Z",
|
||||
"shell.execute_reply.started": "2023-04-15T14:33:22.621295Z"
|
||||
"iopub.execute_input": "2023-05-05T07:19:08.537806Z",
|
||||
"iopub.status.busy": "2023-05-05T07:19:08.536964Z",
|
||||
"iopub.status.idle": "2023-05-05T07:19:08.596852Z",
|
||||
"shell.execute_reply": "2023-05-05T07:19:08.595844Z",
|
||||
"shell.execute_reply.started": "2023-05-05T07:19:08.537767Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -235,7 +228,7 @@
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位/部门','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位/部门','身高','','体重','','肺活量','','握力','','坐位体前屈','','纵跳','','俯卧撑','','一分钟仰卧起坐','','单脚站立','','选择反应时','','台阶指数']\n",
|
||||
"filename = 'data/result_上地派出所.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
@@ -248,17 +241,20 @@
|
||||
"for k, v in dict1.items():\n",
|
||||
" list2 = []\n",
|
||||
" list2.append(str(k).rjust(5,'0'))\n",
|
||||
" list2.append(v['name']) \n",
|
||||
" list2.append(dict2[k]['name']) \n",
|
||||
" list2.append(dict2[k]['sex'])\n",
|
||||
" list2.append(dict2[k]['unit']) \n",
|
||||
" \n",
|
||||
" list2.append(dict2[k]['unit'])\n",
|
||||
" for item in items:\n",
|
||||
" if item in v.keys():\n",
|
||||
" list2.append(v[item]['成绩']) \n",
|
||||
" if item in dict1[k].keys():\n",
|
||||
" list2.append(dict1[k][item]['成绩'])\n",
|
||||
" list2.append(dict1[k][item]['得分']) \n",
|
||||
" elif item =='name':\n",
|
||||
" list2.append(v[item])\n",
|
||||
" list2.append(dict1[k][item])\n",
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list2.append('')\n",
|
||||
" list2.append(dict1[k]['总分'])\n",
|
||||
" list2.append(dict1[k]['平均分'])\n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/上地派出所体测情况表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
@@ -270,10 +266,80 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c6ef75ff-0aa5-422d-a21c-98e2ebe89672",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计项目平均分"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"id": "228b4f0c-deac-41e7-a995-e6d3ea4a0cdf",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-05T08:40:23.243572Z",
|
||||
"iopub.status.busy": "2023-05-05T08:40:23.242724Z",
|
||||
"iopub.status.idle": "2023-05-05T08:40:23.257387Z",
|
||||
"shell.execute_reply": "2023-05-05T08:40:23.256275Z",
|
||||
"shell.execute_reply.started": "2023-05-05T08:40:23.243532Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"体重 3.18\n",
|
||||
"肺活量 3.75\n",
|
||||
"握力 2.23\n",
|
||||
"坐位体前屈 2.79\n",
|
||||
"纵跳 2.72\n",
|
||||
"俯卧撑 3.24\n",
|
||||
"一分钟仰卧起坐 3.83\n",
|
||||
"单脚站立 1.77\n",
|
||||
"选择反应时 3.73\n",
|
||||
"台阶指数 2.52\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"items = ['体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位/部门','身高','','体重','','肺活量','','握力','','坐位体前屈','','纵跳','','俯卧撑','','一分钟仰卧起坐','','单脚站立','','选择反应时','','台阶指数']\n",
|
||||
"filename = 'data/result_上地派出所.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"filename = 'data/上地派出所人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
" \n",
|
||||
"list1 = []\n",
|
||||
"\n",
|
||||
"for item in items:\n",
|
||||
" i = 0\n",
|
||||
" score = 0\n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" if item in v.keys():\n",
|
||||
" score = int(v[item]['得分']) + score \n",
|
||||
" i = i + 1\n",
|
||||
" \n",
|
||||
" \n",
|
||||
" print(item,round(score/i,2)) \n",
|
||||
" \n",
|
||||
" \n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "6f7c8be9-8910-4570-bc09-45f464c77ce9",
|
||||
"id": "fc3c36c2-4697-4709-b755-ec6ade9451bd",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
+208
-1
@@ -1162,10 +1162,217 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b0f8f072-c8d2-4259-8785-4f2a37a06b66",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 生成参加评测人员信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 51,
|
||||
"id": "ec6779c9-4cf2-4fb9-b6ce-430eeca07046",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-05T00:42:59.292182Z",
|
||||
"iopub.status.busy": "2023-05-05T00:42:59.291341Z",
|
||||
"iopub.status.idle": "2023-05-05T00:42:59.515203Z",
|
||||
"shell.execute_reply": "2023-05-05T00:42:59.514466Z",
|
||||
"shell.execute_reply.started": "2023-05-05T00:42:59.292142Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"452\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"import glob,os,shutil\n",
|
||||
"from pathlib2 import Path\n",
|
||||
"import csv\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/淄博交警支队人员名单(排序花名册).xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
"depart = []\n",
|
||||
"for n in range(2, sheet.max_row+1):\n",
|
||||
" if sheet.cell(n,2).value is None:\n",
|
||||
" break\n",
|
||||
" else: \n",
|
||||
" phone = sheet.cell(n, 5).value \n",
|
||||
" person.setdefault(phone, {})\n",
|
||||
" dict1 = {}\n",
|
||||
" dict1['name'] = sheet.cell(n, 2).value \n",
|
||||
" xb = str(sheet.cell(n, 3).value)\n",
|
||||
" if xb == '1':\n",
|
||||
" sex = '男'\n",
|
||||
" elif xb =='2':\n",
|
||||
" sex = '女'\n",
|
||||
" dict1['sex'] = sex\n",
|
||||
" dict1['unit'] = sheet.cell(n, 1).value\n",
|
||||
" person[phone] = dict1\n",
|
||||
"list1 = []\n",
|
||||
"dict1 = {}\n",
|
||||
"old = []\n",
|
||||
"fi_path = 'file/132/20230425'\n",
|
||||
"fl=glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
"print(len(fl))\n",
|
||||
"for fn in fl:\n",
|
||||
" phone = Path(fn).stem\n",
|
||||
" if phone in person.keys():\n",
|
||||
" name = person[phone]['name']\n",
|
||||
" unit = person[phone]['unit']\n",
|
||||
" sex = person[phone]['sex']\n",
|
||||
" else:\n",
|
||||
" name = ''\n",
|
||||
" unit ='未明确部门'\n",
|
||||
" sex = ''\n",
|
||||
" if unit not in depart:\n",
|
||||
" depart.append(unit)\n",
|
||||
" dict1[phone] = {'name':name,'unit':unit,'sex':sex}\n",
|
||||
"filename = 'data/淄博交警参加测评人员.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl,ensure_ascii=False) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "f9686f85-2d33-4e4d-8d4d-498237c26d2c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 生成心理测评人员明细"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 52,
|
||||
"id": "b915259c-755b-4d8a-98f0-ef8707624b38",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-05T00:43:56.396524Z",
|
||||
"iopub.status.busy": "2023-05-05T00:43:56.395990Z",
|
||||
"iopub.status.idle": "2023-05-05T00:43:56.874426Z",
|
||||
"shell.execute_reply": "2023-05-05T00:43:56.873679Z",
|
||||
"shell.execute_reply.started": "2023-05-05T00:43:56.396492Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"filename = 'data/淄博交警参加测评人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"cjry = set()\n",
|
||||
"filename = 'data/Survey_20230424-psy3.csv'\n",
|
||||
"list2 = []\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",
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" phone = str(line[2])\n",
|
||||
" result = json.loads(line[5]) \n",
|
||||
" \n",
|
||||
" if phone in dict1.keys():\n",
|
||||
" list1 = []\n",
|
||||
" \n",
|
||||
" list1.append(phone)\n",
|
||||
" list1.append(dict1[phone]['name'])\n",
|
||||
" list1.append(dict1[phone]['sex'])\n",
|
||||
" list1.append(dict1[phone]['unit'])\n",
|
||||
" #print(k,v['phone'],type(result))\n",
|
||||
" for k1, v1 in result.items():\n",
|
||||
" list1.append(v1)\n",
|
||||
" list2.append(list1)\n",
|
||||
"filename = 'data/交警心理评估明细表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b19438f4-1fbe-480f-9809-3db7af008812",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 生成中医测评人员明细"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 53,
|
||||
"id": "596b26a5-42cc-400f-8c6f-39bfa0fb9233",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-05T00:46:28.321827Z",
|
||||
"iopub.status.busy": "2023-05-05T00:46:28.321422Z",
|
||||
"iopub.status.idle": "2023-05-05T00:46:28.612694Z",
|
||||
"shell.execute_reply": "2023-05-05T00:46:28.612003Z",
|
||||
"shell.execute_reply.started": "2023-05-05T00:46:28.321799Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"filename = 'data/淄博交警参加测评人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"cjry = set()\n",
|
||||
"filename = 'data/Survey_20230424-tcm5.csv'\n",
|
||||
"list2 = []\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",
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" phone = str(line[2])\n",
|
||||
" result = json.loads(line[5]) \n",
|
||||
" \n",
|
||||
" if phone in dict1.keys():\n",
|
||||
" list1 = []\n",
|
||||
" \n",
|
||||
" list1.append(phone)\n",
|
||||
" list1.append(dict1[phone]['name'])\n",
|
||||
" list1.append(dict1[phone]['sex'])\n",
|
||||
" list1.append(dict1[phone]['unit'])\n",
|
||||
" #print(k,v['phone'],type(result))\n",
|
||||
" for k1, v1 in result.items():\n",
|
||||
" list1.append(v1)\n",
|
||||
" list2.append(list1)\n",
|
||||
"filename = 'data/交警中医评估明细表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c26f4d44-d58d-4a37-a117-ac4a90a67866",
|
||||
"id": "eac36b4d-943b-4d1f-9d64-f1c63daf7b40",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
+196
-3
@@ -96,7 +96,7 @@
|
||||
"id": "a430da5f-1e5c-447f-96a1-344d03e57b31",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 统计心理测评人员"
|
||||
"### 统计未参加心理测评人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -139,6 +139,82 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "18b228d6-de4c-4274-b91e-53ca916d15cc",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T13:23:00.486920Z",
|
||||
"iopub.status.busy": "2023-05-04T13:23:00.486074Z",
|
||||
"iopub.status.idle": "2023-05-04T13:23:00.491430Z",
|
||||
"shell.execute_reply": "2023-05-04T13:23:00.490205Z",
|
||||
"shell.execute_reply.started": "2023-05-04T13:23:00.486878Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"### 生成心理测评人员明细"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 56,
|
||||
"id": "2909ec13-dd9e-4101-baee-d305a5804d36",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T14:05:07.858342Z",
|
||||
"iopub.status.busy": "2023-05-04T14:05:07.857920Z",
|
||||
"iopub.status.idle": "2023-05-04T14:05:08.265951Z",
|
||||
"shell.execute_reply": "2023-05-04T14:05:08.265237Z",
|
||||
"shell.execute_reply.started": "2023-05-04T14:05:07.858314Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"filename = 'data/高新区.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"cjry = set()\n",
|
||||
"filename = 'data/Survey_20230424-psy.csv'\n",
|
||||
"list2 = []\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",
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" phone = str(line[2])\n",
|
||||
" result = json.loads(line[5])\n",
|
||||
" \n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" if 'phone' in v.keys() and v['phone'] == phone:\n",
|
||||
" list1 = []\n",
|
||||
" list1.append(k)\n",
|
||||
" list1.append(phone)\n",
|
||||
" list1.append(v['name'])\n",
|
||||
" list1.append(v['sex'])\n",
|
||||
" if 'unit' in v.keys():\n",
|
||||
" unit = v['unit']\n",
|
||||
" else:\n",
|
||||
" unit = ' '\n",
|
||||
" list1.append(unit)\n",
|
||||
" #print(k,v['phone'],type(result))\n",
|
||||
" for k1, v1 in result.items():\n",
|
||||
" list1.append(v1)\n",
|
||||
" list2.append(list1)\n",
|
||||
"filename = 'data/高新心理评估明细表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "519d9b3a-d0d8-44aa-a17d-65e7f21f088b",
|
||||
@@ -187,6 +263,73 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d1edbc30-71a4-438d-ba35-a450f1519b7d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 生成中医测评人员明细"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 57,
|
||||
"id": "57adb577-f1fb-48ee-aed9-985bb44030b5",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T14:26:36.375248Z",
|
||||
"iopub.status.busy": "2023-05-04T14:26:36.374749Z",
|
||||
"iopub.status.idle": "2023-05-04T14:26:36.793076Z",
|
||||
"shell.execute_reply": "2023-05-04T14:26:36.792383Z",
|
||||
"shell.execute_reply.started": "2023-05-04T14:26:36.375200Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"filename = 'data/高新区.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"cjry = set()\n",
|
||||
"filename = 'data/Survey_20230424-tcm1.csv'\n",
|
||||
"list2 = []\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",
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" phone = str(line[2])\n",
|
||||
" result = json.loads(line[5])\n",
|
||||
" \n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" if 'phone' in v.keys() and v['phone'] == phone:\n",
|
||||
" list1 = []\n",
|
||||
" list1.append(k)\n",
|
||||
" list1.append(phone)\n",
|
||||
" list1.append(v['name'])\n",
|
||||
" list1.append(v['sex'])\n",
|
||||
" if 'unit' in v.keys():\n",
|
||||
" unit = v['unit']\n",
|
||||
" else:\n",
|
||||
" unit = ' '\n",
|
||||
" list1.append(unit)\n",
|
||||
" #print(k,v['phone'],type(result))\n",
|
||||
" for k1, v1 in result.items():\n",
|
||||
" list1.append(v1)\n",
|
||||
" list2.append(list1)\n",
|
||||
"filename = 'data/高新中医明细表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0b717a78-52db-4894-83c6-731a4935a02d",
|
||||
@@ -427,13 +570,63 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5b14e6f4-2587-4819-ab97-8ec70a39a2ac",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 心理测评计分分析"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "f5910a5a-05a5-404f-b3e9-eca86226e244",
|
||||
"id": "0274163c-ae65-41a4-bb27-ba9077a365db",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"filename = 'data/高新区.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"cjry = set()\n",
|
||||
"filename = 'data/Survey_20230424-psy.csv'\n",
|
||||
"list2 = []\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",
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" phone = str(line[2])\n",
|
||||
" result = json.loads(line[5])\n",
|
||||
" \n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" if 'phone' in v.keys() and v['phone'] == phone:\n",
|
||||
" list1 = []\n",
|
||||
" list1.append(k)\n",
|
||||
" list1.append(phone)\n",
|
||||
" list1.append(v['name'])\n",
|
||||
" list1.append(v['sex'])\n",
|
||||
" if 'unit' in v.keys():\n",
|
||||
" unit = v['unit']\n",
|
||||
" else:\n",
|
||||
" unit = ' '\n",
|
||||
" list1.append(unit)\n",
|
||||
" #print(k,v['phone'],type(result))\n",
|
||||
" for k1, v1 in result.items():\n",
|
||||
" list1.append(v1)\n",
|
||||
" list2.append(list1)\n",
|
||||
"filename = 'data/高新心理评估明细表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
+148
-77
@@ -10,15 +10,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 153,
|
||||
"execution_count": 189,
|
||||
"id": "1b92b7c5-cb77-49da-95b7-34827ecf1d16",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T11:27:38.797630Z",
|
||||
"iopub.status.busy": "2023-05-04T11:27:38.796775Z",
|
||||
"iopub.status.idle": "2023-05-04T11:27:41.228231Z",
|
||||
"shell.execute_reply": "2023-05-04T11:27:41.227480Z",
|
||||
"shell.execute_reply.started": "2023-05-04T11:27:38.797589Z"
|
||||
"iopub.execute_input": "2023-05-06T12:34:05.214342Z",
|
||||
"iopub.status.busy": "2023-05-06T12:34:05.213544Z",
|
||||
"iopub.status.idle": "2023-05-06T12:34:07.669288Z",
|
||||
"shell.execute_reply": "2023-05-06T12:34:07.668464Z",
|
||||
"shell.execute_reply.started": "2023-05-06T12:34:05.214303Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -89,15 +89,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 154,
|
||||
"execution_count": 190,
|
||||
"id": "71e1ec6a-6797-4496-969a-1d1461b9ea58",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T11:27:59.843239Z",
|
||||
"iopub.status.busy": "2023-05-04T11:27:59.842790Z",
|
||||
"iopub.status.idle": "2023-05-04T11:28:00.142474Z",
|
||||
"shell.execute_reply": "2023-05-04T11:28:00.141539Z",
|
||||
"shell.execute_reply.started": "2023-05-04T11:27:59.843195Z"
|
||||
"iopub.execute_input": "2023-05-06T12:34:21.357836Z",
|
||||
"iopub.status.busy": "2023-05-06T12:34:21.356991Z",
|
||||
"iopub.status.idle": "2023-05-06T12:34:21.689244Z",
|
||||
"shell.execute_reply": "2023-05-06T12:34:21.688513Z",
|
||||
"shell.execute_reply.started": "2023-05-06T12:34:21.357796Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -106,9 +106,10 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"466\n",
|
||||
"466\n",
|
||||
"4602\n"
|
||||
"399\n",
|
||||
"999 张术申 已测试!\n",
|
||||
"399\n",
|
||||
"5478\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -131,7 +132,7 @@
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20230504.csv'\n",
|
||||
"filename = 'data/places_result_20230506.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -164,7 +165,7 @@
|
||||
" else:\n",
|
||||
" for k1,v1 in v.items():\n",
|
||||
" dict2[k][k1] = v1\n",
|
||||
"filename = 'data/result_燕山石化(20230504).json'\n",
|
||||
"filename = 'data/result_燕山石化(20230506).json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
"print(len(re_ta))\n",
|
||||
@@ -184,15 +185,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 156,
|
||||
"execution_count": 191,
|
||||
"id": "c24880ad-bbbd-4ad8-a894-cbcea389e822",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T11:28:48.304876Z",
|
||||
"iopub.status.busy": "2023-05-04T11:28:48.304030Z",
|
||||
"iopub.status.idle": "2023-05-04T11:28:48.493153Z",
|
||||
"shell.execute_reply": "2023-05-04T11:28:48.492438Z",
|
||||
"shell.execute_reply.started": "2023-05-04T11:28:48.304834Z"
|
||||
"iopub.execute_input": "2023-05-06T12:36:51.312280Z",
|
||||
"iopub.status.busy": "2023-05-06T12:36:51.311429Z",
|
||||
"iopub.status.idle": "2023-05-06T12:36:51.482418Z",
|
||||
"shell.execute_reply": "2023-05-06T12:36:51.481718Z",
|
||||
"shell.execute_reply.started": "2023-05-06T12:36:51.312239Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -204,7 +205,7 @@
|
||||
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"\n",
|
||||
"filename = 'data/result_燕山石化(20230504).json'\n",
|
||||
"filename = 'data/result_燕山石化(20230506).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -229,7 +230,7 @@
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/燕山石化体测情况表(20230504).xlsx'\n",
|
||||
"filename = 'data/燕山石化体测情况表(20230506).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -249,15 +250,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 157,
|
||||
"execution_count": 161,
|
||||
"id": "68454877-f1fe-4eed-8a48-265e428f892e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-04T11:29:06.618769Z",
|
||||
"iopub.status.busy": "2023-05-04T11:29:06.617928Z",
|
||||
"iopub.status.idle": "2023-05-04T11:29:06.651954Z",
|
||||
"shell.execute_reply": "2023-05-04T11:29:06.651052Z",
|
||||
"shell.execute_reply.started": "2023-05-04T11:29:06.618729Z"
|
||||
"iopub.execute_input": "2023-05-05T13:17:08.413642Z",
|
||||
"iopub.status.busy": "2023-05-05T13:17:08.412783Z",
|
||||
"iopub.status.idle": "2023-05-05T13:17:08.447423Z",
|
||||
"shell.execute_reply": "2023-05-05T13:17:08.446331Z",
|
||||
"shell.execute_reply.started": "2023-05-05T13:17:08.413601Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -266,7 +267,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'储运厂工会': 254, '合成树脂厂': 114, '检验计量中心工会': 13, '合成橡胶厂工会': 19, '炼油厂工会': 26, '化学品厂工会': 17, '烯烃厂工会': 12, '热电厂工会': 11}\n"
|
||||
"{'储运厂工会': 216, '合成树脂厂': 93, '热电厂工会': 31, '合成橡胶厂工会': 34, '检验计量中心工会': 14, '化学品厂工会': 35, '烯烃厂工会': 9, '炼油厂工会': 40, '有机化工厂工会': 4, '机关工会': 2, '行政事务中心(离退中心)工会': 1, '物装中心工会': 1}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -274,7 +275,7 @@
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"filename = 'data/result_燕山石化(20230504).json'\n",
|
||||
"filename = 'data/result_燕山石化(20230505).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"dict2 = {}\n",
|
||||
@@ -289,7 +290,7 @@
|
||||
" list2 = []\n",
|
||||
" list2 = [k,v]\n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/燕山石化部门测试人数情况表(20230504).xlsx'\n",
|
||||
"filename = 'data/燕山石化部门测试人数情况表(20230505).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -366,15 +367,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 148,
|
||||
"execution_count": 195,
|
||||
"id": "eddf7dab-b28d-402a-aeaf-27c120048ecb",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-27T12:02:16.168114Z",
|
||||
"iopub.status.busy": "2023-04-27T12:02:16.167671Z",
|
||||
"iopub.status.idle": "2023-04-27T12:02:16.802793Z",
|
||||
"shell.execute_reply": "2023-04-27T12:02:16.802099Z",
|
||||
"shell.execute_reply.started": "2023-04-27T12:02:16.168084Z"
|
||||
"iopub.execute_input": "2023-05-06T12:57:06.594280Z",
|
||||
"iopub.status.busy": "2023-05-06T12:57:06.593411Z",
|
||||
"iopub.status.idle": "2023-05-06T12:57:07.225472Z",
|
||||
"shell.execute_reply": "2023-05-06T12:57:07.224722Z",
|
||||
"shell.execute_reply.started": "2023-05-06T12:57:06.594240Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -390,7 +391,7 @@
|
||||
" dict1 = json.load(fl)\n",
|
||||
"# 筛选重名剔除名单\n",
|
||||
"chongming = []\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况.xlsx'\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况(20230506).xlsx'\n",
|
||||
"wb = openpyxl.load_workbook(filename)\n",
|
||||
"sheet = wb.active\n",
|
||||
"for n in range(1, sheet.max_row+1,2):\n",
|
||||
@@ -419,7 +420,7 @@
|
||||
" list2.append(dict2[k]['车间'])\n",
|
||||
" list2.append(dict2[k]['班组'])\n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/燕山石化未体测人员名单(截至20230427).xlsx'\n",
|
||||
"filename = 'data/燕山石化未体测人员名单(截至20230506).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -439,15 +440,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 123,
|
||||
"execution_count": 188,
|
||||
"id": "641863ef-324f-4c33-a0a9-699031afb6f1",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-26T11:17:42.517140Z",
|
||||
"iopub.status.busy": "2023-04-26T11:17:42.516342Z",
|
||||
"iopub.status.idle": "2023-04-26T11:17:42.630705Z",
|
||||
"shell.execute_reply": "2023-04-26T11:17:42.629971Z",
|
||||
"shell.execute_reply.started": "2023-04-26T11:17:42.517107Z"
|
||||
"iopub.execute_input": "2023-05-06T04:49:09.959460Z",
|
||||
"iopub.status.busy": "2023-05-06T04:49:09.958827Z",
|
||||
"iopub.status.idle": "2023-05-06T04:49:10.100983Z",
|
||||
"shell.execute_reply": "2023-05-06T04:49:10.100011Z",
|
||||
"shell.execute_reply.started": "2023-05-06T04:49:09.959429Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -456,23 +457,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"7756 张志兴 ['身高', '体重', '肺活量', '握力']\n",
|
||||
"3999 解勇 ['身高', '体重', '肺活量', '握力']\n",
|
||||
"7037 郭维东 ['身高', '体重', '握力', '选择反应时']\n",
|
||||
"57 郑文芬 ['身高', '体重', '坐位体前屈', '握力']\n",
|
||||
"4031 庞荔元 ['身高', '体重', '肺活量', '选择反应时']\n",
|
||||
"4025 马珺 ['身高', '体重', '选择反应时']\n",
|
||||
"7790 吴志鹏 ['身高', '体重', '握力']\n",
|
||||
"4851 李晓甦 ['身高', '体重', '单脚站立', '握力']\n",
|
||||
"8133 张来强 ['身高', '体重', '肺活量', '选择反应时']\n",
|
||||
"5628 康文刚 ['身高', '体重', '肺活量', '握力']\n",
|
||||
"8151 赵春先 ['身高', '体重', '握力']\n",
|
||||
"3699 毛树新 ['身高', '体重', '纵跳', '选择反应时']\n",
|
||||
"1699 孙雪飞 ['身高', '体重', '肺活量', '选择反应时']\n",
|
||||
"1960 徐慧国 ['身高', '体重', '肺活量', '单脚站立']\n",
|
||||
"3563 孙志强 ['身高', '体重', '握力', '纵跳']\n",
|
||||
"7682 孙宏林 ['肺活量', '身高', '体重']\n",
|
||||
"4370 张宝 ['身高', '体重', '肺活量', '选择反应时']\n"
|
||||
"[['4025', '马珺', '教育培训中心工会', '身高,体重,选择反应时'], ['7790', '吴志鹏', '生产运行保障中心', '身高,体重,握力'], ['2349', '王军海', '合成橡胶厂工会', '身高,体重'], ['8151', '赵春先', '合成树脂厂', '身高,体重,握力'], ['7682', '孙宏林', '有机化工厂工会', '肺活量,身高,体重'], ['2004', '刘鹏', '合成树脂厂', '身高,体重,握力'], ['642', '刘小宾', '储运厂工会', '身高,体重,肺活量'], ['3125', '李志斌', '化学品厂工会', '身高,体重,握力']]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -496,10 +481,25 @@
|
||||
" if item in items:\n",
|
||||
" list1.append(item)\n",
|
||||
" dict3[k] = list1\n",
|
||||
"list1 = []\n",
|
||||
"for k, v in dict3.items():\n",
|
||||
" if len(v)<=4 and '身高' in v and '体重' in v:\n",
|
||||
" print(k,dict2[k]['name'],v)\n",
|
||||
" "
|
||||
" if len(v)<4 and '身高' in v and '体重' in v:\n",
|
||||
" list2 = []\n",
|
||||
" xm = ','.join(v)\n",
|
||||
" list2.append(k)\n",
|
||||
" list2.append(dict2[k]['name'])\n",
|
||||
" list2.append(dict2[k]['工作单位'])\n",
|
||||
" list2.append(xm)\n",
|
||||
" list1.append(list2)\n",
|
||||
"print(list1)\n",
|
||||
"filename = 'data/燕山石化测试项目不足人员(截止5月5日).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list1:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename) \n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -649,15 +649,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 137,
|
||||
"execution_count": 194,
|
||||
"id": "5df8eb8f-3594-40be-a491-b4d750bbd554",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-27T08:23:39.947764Z",
|
||||
"iopub.status.busy": "2023-04-27T08:23:39.947326Z",
|
||||
"iopub.status.idle": "2023-04-27T08:23:40.072095Z",
|
||||
"shell.execute_reply": "2023-04-27T08:23:40.071367Z",
|
||||
"shell.execute_reply.started": "2023-04-27T08:23:39.947734Z"
|
||||
"iopub.execute_input": "2023-05-06T12:56:19.780009Z",
|
||||
"iopub.status.busy": "2023-05-06T12:56:19.779277Z",
|
||||
"iopub.status.idle": "2023-05-06T12:56:19.924293Z",
|
||||
"shell.execute_reply": "2023-05-06T12:56:19.923570Z",
|
||||
"shell.execute_reply.started": "2023-05-06T12:56:19.779982Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -673,7 +673,7 @@
|
||||
"filename = 'data/燕山石化人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"filename = 'data/result_燕山石化-all.json'\n",
|
||||
"filename = 'data/result_燕山石化.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"\n",
|
||||
@@ -696,7 +696,7 @@
|
||||
" else:\n",
|
||||
" ce = '否'\n",
|
||||
" list3.append([code,name,unit,ce])\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况.xlsx'\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况(20230506).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
@@ -706,10 +706,81 @@
|
||||
"wb.save(filename) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0513a787-f2e2-4ee6-9c67-c94c50e62393",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计部门测试情况"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 193,
|
||||
"id": "48a0b2b8-c069-4d2d-9813-d65474749000",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-06T12:38:29.815090Z",
|
||||
"iopub.status.busy": "2023-05-06T12:38:29.814674Z",
|
||||
"iopub.status.idle": "2023-05-06T12:38:29.943125Z",
|
||||
"shell.execute_reply": "2023-05-06T12:38:29.942309Z",
|
||||
"shell.execute_reply.started": "2023-05-06T12:38:29.815063Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[['机关工会', 446, 365], ['储运厂工会', 997, 780], ['高科公司工会', 311, 292], ['合成树脂厂', 464, 317], ['合成橡胶厂工会', 770, 310], ['化学品厂工会', 378, 296], ['检验计量中心工会', 635, 297], ['教育培训中心工会', 73, 72], ['炼油厂工会', 1043, 640], ['热电厂工会', 710, 121], ['物装中心工会', 182, 182], ['烯烃厂工会', 433, 287], ['消防中心工会', 221, 214], ['行政事务中心(离退中心)工会', 675, 503], ['有机化工厂工会', 454, 435], ['生产运行保障中心', 398, 367]]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"filename = 'data/燕山石化人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"filename = 'data/result_燕山石化.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"dict2 = {}\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" unit = v['工作单位']\n",
|
||||
" dict2.setdefault(unit,0)\n",
|
||||
" dict2[unit] = dict2[unit] + 1\n",
|
||||
"dict4 = {}\n",
|
||||
"for k, v in dict3.items():\n",
|
||||
" unit = v['部门']\n",
|
||||
" dict4.setdefault(unit,0)\n",
|
||||
" dict4[unit] = dict4[unit] + 1\n",
|
||||
"list1 = []\n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" list2 = []\n",
|
||||
" list2.append(k)\n",
|
||||
" list2.append(v)\n",
|
||||
" if k in dict4.keys():\n",
|
||||
" list2.append(dict4[k])\n",
|
||||
" else:\n",
|
||||
" list2.append(0)\n",
|
||||
" list1.append(list2)\n",
|
||||
"print(list1)\n",
|
||||
"filename = 'data/燕山石化部门测试情况(截止5月6日).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list1:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename) \n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "bfd8e77d-85a5-44aa-b075-b37278910a3f",
|
||||
"id": "c294db76-adc4-41bf-9ee6-811dde1905e8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
+15
-15
@@ -149,15 +149,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"execution_count": 42,
|
||||
"id": "97d86ce2-6664-41a1-89d2-ddaa0611bac1",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-27T07:07:54.855417Z",
|
||||
"iopub.status.busy": "2023-04-27T07:07:54.854561Z",
|
||||
"iopub.status.idle": "2023-04-27T07:07:54.933949Z",
|
||||
"shell.execute_reply": "2023-04-27T07:07:54.932922Z",
|
||||
"shell.execute_reply.started": "2023-04-27T07:07:54.855376Z"
|
||||
"iopub.execute_input": "2023-05-05T13:31:23.049611Z",
|
||||
"iopub.status.busy": "2023-05-05T13:31:23.048757Z",
|
||||
"iopub.status.idle": "2023-05-05T13:31:23.590103Z",
|
||||
"shell.execute_reply": "2023-05-05T13:31:23.589419Z",
|
||||
"shell.execute_reply.started": "2023-05-05T13:31:23.049566Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -168,7 +168,7 @@
|
||||
"\n",
|
||||
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"filename = 'data/result_石家庄(20230427).json'\n",
|
||||
"filename = 'data/result_石家庄.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -192,7 +192,7 @@
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/石家庄石化体测情况表(20230427).xlsx'\n",
|
||||
"filename = 'data/石家庄石化体测情况表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -212,15 +212,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 38,
|
||||
"execution_count": 41,
|
||||
"id": "e2b68cb1-3a6f-4b51-afbd-d6c9634348b1",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-27T07:10:23.308568Z",
|
||||
"iopub.status.busy": "2023-04-27T07:10:23.307717Z",
|
||||
"iopub.status.idle": "2023-04-27T07:10:23.593399Z",
|
||||
"shell.execute_reply": "2023-04-27T07:10:23.592690Z",
|
||||
"shell.execute_reply.started": "2023-04-27T07:10:23.308525Z"
|
||||
"iopub.execute_input": "2023-05-05T13:30:29.397704Z",
|
||||
"iopub.status.busy": "2023-05-05T13:30:29.396865Z",
|
||||
"iopub.status.idle": "2023-05-05T13:30:29.654357Z",
|
||||
"shell.execute_reply": "2023-05-05T13:30:29.653607Z",
|
||||
"shell.execute_reply.started": "2023-05-05T13:30:29.397657Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -253,7 +253,7 @@
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20230427-sjz-all.csv'\n",
|
||||
"filename = 'data/places_result_20230505-sjz.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
|
||||
+18
-18
@@ -72,15 +72,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 16,
|
||||
"id": "4b52477e-926a-44b5-b8a0-20bff98d101d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-28T02:29:30.505134Z",
|
||||
"iopub.status.busy": "2023-04-28T02:29:30.504270Z",
|
||||
"iopub.status.idle": "2023-04-28T02:29:30.603183Z",
|
||||
"shell.execute_reply": "2023-04-28T02:29:30.602480Z",
|
||||
"shell.execute_reply.started": "2023-04-28T02:29:30.505092Z"
|
||||
"iopub.execute_input": "2023-05-05T13:53:58.994696Z",
|
||||
"iopub.status.busy": "2023-05-05T13:53:58.993862Z",
|
||||
"iopub.status.idle": "2023-05-05T13:53:59.019923Z",
|
||||
"shell.execute_reply": "2023-05-05T13:53:59.019005Z",
|
||||
"shell.execute_reply.started": "2023-05-05T13:53:58.994649Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -89,8 +89,8 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"33\n",
|
||||
"33\n"
|
||||
"44\n",
|
||||
"44\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -112,8 +112,8 @@
|
||||
"filename = 'data/长炼医院人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"rq = '20230428'\n",
|
||||
"filename = f'data/places_result_{rq}.csv'\n",
|
||||
"rq = '20230505'\n",
|
||||
"filename = f'data/places_result_{rq}-clyy.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -165,7 +165,7 @@
|
||||
"filename = 'data/燕山石化人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"rq = '20230425'\n",
|
||||
"rq = '20230505'\n",
|
||||
"filename = f'data/places_result_{rq}.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
@@ -219,15 +219,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": 17,
|
||||
"id": "2ffa583b-be51-40a8-bb55-de6a89d1a54a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-04-28T02:29:52.437982Z",
|
||||
"iopub.status.busy": "2023-04-28T02:29:52.437174Z",
|
||||
"iopub.status.idle": "2023-04-28T02:29:52.467779Z",
|
||||
"shell.execute_reply": "2023-04-28T02:29:52.466907Z",
|
||||
"shell.execute_reply.started": "2023-04-28T02:29:52.437947Z"
|
||||
"iopub.execute_input": "2023-05-05T13:54:34.525972Z",
|
||||
"iopub.status.busy": "2023-05-05T13:54:34.525125Z",
|
||||
"iopub.status.idle": "2023-05-05T13:54:34.570287Z",
|
||||
"shell.execute_reply": "2023-05-05T13:54:34.569407Z",
|
||||
"shell.execute_reply.started": "2023-05-05T13:54:34.525930Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -236,7 +236,7 @@
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"rq = '20230428'\n",
|
||||
"rq = '20230505'\n",
|
||||
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"filename = f'data/result_长炼医院({rq}).json'\n",
|
||||
|
||||
Reference in new issue
Block a user