From 2e7d800503150917a768ec45e2623a9aa8cbb2b9 Mon Sep 17 00:00:00 2001 From: 512song Date: Tue, 16 May 2023 23:06:49 +0800 Subject: [PATCH] 20230516 --- 体测单位/燕山石化.ipynb | 130 +++--- 体测单位/石家庄石化.ipynb | 960 +++++++++++++++++++++++++++++++++++++- 体测单位/长炼医院.ipynb | 48 +- 3 files changed, 1053 insertions(+), 85 deletions(-) diff --git a/体测单位/燕山石化.ipynb b/体测单位/燕山石化.ipynb index 7c5256d..516997f 100644 --- a/体测单位/燕山石化.ipynb +++ b/体测单位/燕山石化.ipynb @@ -10,15 +10,15 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 32, "id": "1b92b7c5-cb77-49da-95b7-34827ecf1d16", "metadata": { "execution": { - "iopub.execute_input": "2023-05-14T14:13:07.924740Z", - "iopub.status.busy": "2023-05-14T14:13:07.924333Z", - "iopub.status.idle": "2023-05-14T14:13:10.350279Z", - "shell.execute_reply": "2023-05-14T14:13:10.349499Z", - "shell.execute_reply.started": "2023-05-14T14:13:07.924713Z" + "iopub.execute_input": "2023-05-16T06:27:55.181932Z", + "iopub.status.busy": "2023-05-16T06:27:55.181018Z", + "iopub.status.idle": "2023-05-16T06:27:57.546786Z", + "shell.execute_reply": "2023-05-16T06:27:57.545822Z", + "shell.execute_reply.started": "2023-05-16T06:27:55.181895Z" }, "tags": [] }, @@ -27,8 +27,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "8205\n", - "8170\n", + "8206\n", + "8171\n", + "8109\n", "ok\n" ] } @@ -76,11 +77,19 @@ " dict1['工作性质'] = sheet.cell(n, 11).value\n", " person[code] = dict1\n", "jianyuan = [6484,7110,6441,6541,6543,6549,6555,6600,2958,2981,3033,3231,3249,3287,3228,7741,7749,7794,7799,7806,7837,7863,7870,7880,7894,7895,7904,7936,7947,7953,7958,7968,7969,7974,8086,8114]\n", + "\n", "print(len(person))\n", "for k in jianyuan:\n", " if k in person.keys():\n", " del person[k]\n", "print(len(person))\n", + "bianwai =[449,6839]\n", + "for i in range(7139,7200):\n", + " bianwai.append(i)\n", + "for k in bianwai:\n", + " if k in person.keys():\n", + " del person[k]\n", + "print(len(person))\n", "filename = 'data/燕山石化人员名单.json'\n", "with open(filename, 'w') as fl:\n", " json.dump(person, fl, ensure_ascii=False)\n", @@ -97,15 +106,15 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 33, "id": "71e1ec6a-6797-4496-969a-1d1461b9ea58", "metadata": { "execution": { - "iopub.execute_input": "2023-05-13T02:04:57.276284Z", - "iopub.status.busy": "2023-05-13T02:04:57.275446Z", - "iopub.status.idle": "2023-05-13T02:04:57.669774Z", - "shell.execute_reply": "2023-05-13T02:04:57.668967Z", - "shell.execute_reply.started": "2023-05-13T02:04:57.276243Z" + "iopub.execute_input": "2023-05-16T08:36:31.303752Z", + "iopub.status.busy": "2023-05-16T08:36:31.302937Z", + "iopub.status.idle": "2023-05-16T08:36:31.711617Z", + "shell.execute_reply": "2023-05-16T08:36:31.710715Z", + "shell.execute_reply.started": "2023-05-16T08:36:31.303711Z" }, "tags": [] }, @@ -114,9 +123,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "252\n", - "252\n", - "7118\n" + "214\n", + "8151 赵春先 已测试!\n", + "999 张术申 已测试!\n", + "2709 刘巍 已测试!\n", + "214\n", + "7598\n" ] } ], @@ -139,7 +151,7 @@ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", - "filename = 'data/places_result_20230512.csv'\n", + "filename = 'data/places_result_20230516.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -172,7 +184,7 @@ " else:\n", " for k1,v1 in v.items():\n", " dict2[k][k1] = v1\n", - "filename = 'data/result_燕山石化(20230512).json'\n", + "filename = 'data/result_燕山石化(20230516).json'\n", "with open(filename,'w') as fl:\n", " json.dump(re_ta, fl, ensure_ascii=False) \n", "print(len(re_ta))\n", @@ -192,15 +204,15 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 34, "id": "c24880ad-bbbd-4ad8-a894-cbcea389e822", "metadata": { "execution": { - "iopub.execute_input": "2023-05-13T02:05:33.519879Z", - "iopub.status.busy": "2023-05-13T02:05:33.519039Z", - "iopub.status.idle": "2023-05-13T02:05:33.660778Z", - "shell.execute_reply": "2023-05-13T02:05:33.660105Z", - "shell.execute_reply.started": "2023-05-13T02:05:33.519838Z" + "iopub.execute_input": "2023-05-16T08:37:27.708591Z", + "iopub.status.busy": "2023-05-16T08:37:27.707778Z", + "iopub.status.idle": "2023-05-16T08:37:27.839300Z", + "shell.execute_reply": "2023-05-16T08:37:27.838623Z", + "shell.execute_reply.started": "2023-05-16T08:37:27.708561Z" }, "tags": [] }, @@ -212,7 +224,7 @@ "items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "\n", - "filename = 'data/result_燕山石化(20230512).json'\n", + "filename = 'data/result_燕山石化(20230516).json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "\n", @@ -237,7 +249,7 @@ " else:\n", " list2.append('') \n", " list1.append(list2)\n", - "filename = 'data/燕山石化体测情况表(20230512).xlsx'\n", + "filename = 'data/燕山石化体测情况表(20230516).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -322,15 +334,15 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 35, "id": "68454877-f1fe-4eed-8a48-265e428f892e", "metadata": { "execution": { - "iopub.execute_input": "2023-05-13T02:05:45.816647Z", - "iopub.status.busy": "2023-05-13T02:05:45.815801Z", - "iopub.status.idle": "2023-05-13T02:05:45.845435Z", - "shell.execute_reply": "2023-05-13T02:05:45.844361Z", - "shell.execute_reply.started": "2023-05-13T02:05:45.816606Z" + "iopub.execute_input": "2023-05-16T08:37:50.893472Z", + "iopub.status.busy": "2023-05-16T08:37:50.892954Z", + "iopub.status.idle": "2023-05-16T08:37:50.917547Z", + "shell.execute_reply": "2023-05-16T08:37:50.916456Z", + "shell.execute_reply.started": "2023-05-16T08:37:50.893441Z" }, "tags": [] }, @@ -339,7 +351,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'合成橡胶厂工会': 55, '热电厂工会': 104, '检验计量中心工会': 58, '合成树脂厂': 2, '炼油厂工会': 26, '有机化工厂工会': 1, '高科公司工会': 1, '储运厂工会': 1, '化学品厂工会': 3, '烯烃厂工会': 1}\n" + "{'储运厂工会': 9, '热电厂工会': 65, '炼油厂工会': 48, '合成橡胶厂工会': 31, '检验计量中心工会': 34, '烯烃厂工会': 4, '化学品厂工会': 8, '合成树脂厂': 4, '生产运行保障中心': 1, '高科公司工会': 3, '有机化工厂工会': 3, '机关工会': 4}\n" ] } ], @@ -347,7 +359,7 @@ "import json\n", "import openpyxl\n", "\n", - "filename = 'data/result_燕山石化(20230512).json'\n", + "filename = 'data/result_燕山石化(20230516).json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "dict2 = {}\n", @@ -362,7 +374,7 @@ " list2 = []\n", " list2 = [k,v]\n", " list1.append(list2)\n", - "filename = 'data/燕山石化部门测试人数情况表(20230512).xlsx'\n", + "filename = 'data/燕山石化部门测试人数情况表(20230516).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -439,15 +451,15 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 37, "id": "eddf7dab-b28d-402a-aeaf-27c120048ecb", "metadata": { "execution": { - "iopub.execute_input": "2023-05-14T14:17:34.734542Z", - "iopub.status.busy": "2023-05-14T14:17:34.733685Z", - "iopub.status.idle": "2023-05-14T14:17:34.966217Z", - "shell.execute_reply": "2023-05-14T14:17:34.965520Z", - "shell.execute_reply.started": "2023-05-14T14:17:34.734501Z" + "iopub.execute_input": "2023-05-16T08:44:33.173111Z", + "iopub.status.busy": "2023-05-16T08:44:33.172278Z", + "iopub.status.idle": "2023-05-16T08:44:33.373625Z", + "shell.execute_reply": "2023-05-16T08:44:33.372928Z", + "shell.execute_reply.started": "2023-05-16T08:44:33.173071Z" }, "tags": [] }, @@ -458,12 +470,12 @@ "\n", "\n", "title = ['编号','姓名','性别','单位','车间','班组']\n", - "filename = 'data/result_燕山石化-all.json'\n", + "filename = 'data/result_燕山石化.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "# 筛选重名剔除名单\n", "chongming = []\n", - "filename = 'data/燕山石化重名人员测试情况(20230512).xlsx'\n", + "filename = 'data/燕山石化重名人员测试情况(20230515).xlsx'\n", "wb = openpyxl.load_workbook(filename)\n", "sheet = wb.active\n", "for n in range(1, sheet.max_row+1,2):\n", @@ -492,7 +504,7 @@ " list2.append(dict2[k]['车间'])\n", " list2.append(dict2[k]['班组'])\n", " list1.append(list2)\n", - "filename = 'data/燕山石化未体测人员名单(截至20230512).xlsx'\n", + "filename = 'data/燕山石化未体测人员名单(截至20230516).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -720,19 +732,31 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 36, "id": "5df8eb8f-3594-40be-a491-b4d750bbd554", "metadata": { "execution": { - "iopub.execute_input": "2023-05-14T14:17:09.067724Z", - "iopub.status.busy": "2023-05-14T14:17:09.067317Z", - "iopub.status.idle": "2023-05-14T14:17:09.226025Z", - "shell.execute_reply": "2023-05-14T14:17:09.225328Z", - "shell.execute_reply.started": "2023-05-14T14:17:09.067697Z" + "iopub.execute_input": "2023-05-16T08:44:02.431464Z", + "iopub.status.busy": "2023-05-16T08:44:02.430604Z", + "iopub.status.idle": "2023-05-16T08:44:02.587531Z", + "shell.execute_reply": "2023-05-16T08:44:02.586608Z", + "shell.execute_reply.started": "2023-05-16T08:44:02.431421Z" }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "KeyError", + "evalue": "'7160'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[36], line 27\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m sheet\u001b[38;5;241m.\u001b[39mcell(n,\u001b[38;5;241m1\u001b[39m)\u001b[38;5;241m.\u001b[39mvalue \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 26\u001b[0m code \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(sheet\u001b[38;5;241m.\u001b[39mcell(n, \u001b[38;5;241m1\u001b[39m)\u001b[38;5;241m.\u001b[39mvalue)\n\u001b[0;32m---> 27\u001b[0m name \u001b[38;5;241m=\u001b[39m \u001b[43mdict1\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mcode\u001b[49m\u001b[43m)\u001b[49m\u001b[43m]\u001b[49m[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 28\u001b[0m unit \u001b[38;5;241m=\u001b[39m dict1[\u001b[38;5;28mstr\u001b[39m(code)][\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m工作单位\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 29\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mstr\u001b[39m(code) \u001b[38;5;129;01min\u001b[39;00m dict2\u001b[38;5;241m.\u001b[39mkeys():\n", + "\u001b[0;31mKeyError\u001b[0m: '7160'" + ] + } + ], "source": [ "import json\n", "import time\n", @@ -767,7 +791,7 @@ " else:\n", " ce = '否'\n", " list3.append([code,name,unit,ce])\n", - "filename = 'data/燕山石化重名人员测试情况(20230512).xlsx'\n", + "filename = 'data/燕山石化重名人员测试情况(20230516).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "#sheet.append(title)\n", diff --git a/体测单位/石家庄石化.ipynb b/体测单位/石家庄石化.ipynb index bf45093..5467a40 100644 --- a/体测单位/石家庄石化.ipynb +++ b/体测单位/石家庄石化.ipynb @@ -10,15 +10,15 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 8, "id": "9bd78072-29e5-4c98-8bbe-97f525cf9e4a", "metadata": { "execution": { - "iopub.execute_input": "2023-04-26T09:21:52.196489Z", - "iopub.status.busy": "2023-04-26T09:21:52.195668Z", - "iopub.status.idle": "2023-04-26T09:21:52.973388Z", - "shell.execute_reply": "2023-04-26T09:21:52.972674Z", - "shell.execute_reply.started": "2023-04-26T09:21:52.196448Z" + "iopub.execute_input": "2023-05-16T00:37:19.185801Z", + "iopub.status.busy": "2023-05-16T00:37:19.185377Z", + "iopub.status.idle": "2023-05-16T00:37:20.015287Z", + "shell.execute_reply": "2023-05-16T00:37:20.014538Z", + "shell.execute_reply.started": "2023-05-16T00:37:19.185772Z" }, "tags": [] }, @@ -53,10 +53,11 @@ " sex = '女'\n", " dict1['sex'] = sex\n", " dict1['unit'] = sheet.cell(n, 3).value\n", + " dict1['birth'] = sheet.cell(n, 8).value\n", " person[code] = dict1\n", "filename = 'data/石家庄2023.json'\n", "with open(filename, 'w') as fl:\n", - " json.dump(person, fl, ensure_ascii=False)\n", + " json.dump(person, fl, ensure_ascii=False,default=str)\n", "print('ok')" ] }, @@ -450,10 +451,953 @@ "wb.save(filename)\n" ] }, + { + "cell_type": "markdown", + "id": "e0c0ada9-1df7-4c7e-9a56-7e224c636764", + "metadata": {}, + "source": [ + "## 生成查询文件" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "id": "e85c1be2-7859-4b7d-8f67-a9ad12d167d4", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T14:44:53.635480Z", + "iopub.status.busy": "2023-05-16T14:44:53.634628Z", + "iopub.status.idle": "2023-05-16T14:44:53.695874Z", + "shell.execute_reply": "2023-05-16T14:44:53.694856Z", + "shell.execute_reply.started": "2023-05-16T14:44:53.635438Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ok\n" + ] + } + ], + "source": [ + "import json\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "dict2 = {}\n", + "for k, v in dict1.items():\n", + " dict2[k] = v['name']\n", + "filename = 'data/shijiazhuang.json'\n", + "with open(filename, 'w') as fl:\n", + " json.dump(dict2, fl, ensure_ascii=False)\n", + "print('ok')\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "3a3ae88b-a59b-4403-9c98-685afe1f5268", + "metadata": {}, + "source": [ + "## 数据分析" + ] + }, + { + "cell_type": "markdown", + "id": "420510cf-c96b-4765-87c2-2911b1d4210a", + "metadata": {}, + "source": [ + "### 获取清理后报告数据" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "c9e4f67a-a34d-4c81-9ed7-9099d3f283f4", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T06:42:46.952331Z", + "iopub.status.busy": "2023-05-16T06:42:46.951922Z", + "iopub.status.idle": "2023-05-16T06:42:47.188427Z", + "shell.execute_reply": "2023-05-16T06:42:47.187703Z", + "shell.execute_reply.started": "2023-05-16T06:42:46.952303Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2253\n", + "['988', '2088', '2199', '1112', '2192', '523', '584', '170', '89', '1974', '1181', '1926', '846', '850', '2324', '2098', '2024', '2083', '1329', '1237']\n", + "2233\n", + "ok\n" + ] + } + ], + "source": [ + "import json\n", + "import time\n", + "import csv\n", + "\n", + "filename = '../item.json'\n", + "item = {}\n", + "unit = {}\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/石家庄2023.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "re_ta = {}\n", + "list1 = []\n", + "#print(\"\\n运动项目信息:\")\n", + "filename = 'data/places_result_sjz.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[2])\n", + " if user in dict1.keys():\n", + " \n", + " m_item = str(result[3]) \n", + " re_ta.setdefault(user,{}) \n", + " re_ta[user]['name'] = dict1[user]['name']\n", + " re_ta[user]['unit'] = dict1[user]['unit']\n", + " re_ta[user]['sex'] = dict1[user]['sex']\n", + " re_ta[user]['birth'] = dict1[user]['birth']\n", + " item_name = item[m_item]['name']\n", + " re_ta[user].setdefault(item_name,{}) \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[5]\n", + "filename = 'data/result_石家庄.json'\n", + "print(len(re_ta))\n", + "liwai = []\n", + "for k, v in re_ta.items():\n", + " if (len(v)<8 and '身高' in v and '体重' in v) or (len(v)<7 and '身高' not in v and '体重' not in v) :\n", + " liwai.append(k)\n", + "print(liwai)\n", + "for k in liwai:\n", + " del re_ta[k]\n", + "print(len(re_ta))\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'w') as fl:\n", + " json.dump(re_ta, fl) \n", + "print('ok')" + ] + }, + { + "cell_type": "markdown", + "id": "25bf52c2-0d84-4299-94af-5845d5156a93", + "metadata": {}, + "source": [ + "### 核对报告" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "3a8f7e29-aff1-4a5b-b31d-1c47aaf1e2fa", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T01:34:43.883914Z", + "iopub.status.busy": "2023-05-16T01:34:43.883060Z", + "iopub.status.idle": "2023-05-16T01:34:43.990826Z", + "shell.execute_reply": "2023-05-16T01:34:43.989773Z", + "shell.execute_reply.started": "2023-05-16T01:34:43.883871Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2388 {'name': '任宁', 'unit': '化工运行部', 'sex': '男', 'birth': '1982-01-16 00:00:00', '肺活量': {'成绩': '3292.0 毫升', '得分': '3'}, '选择反应时': {'成绩': '0.56 秒', '得分': '3'}, '握力': {'成绩': '41.6 千克', '得分': '2'}} \n", + "\n", + "986 {'name': '左少卿', 'unit': '炼油运行一部', 'sex': '男', 'birth': '1990-1-1', '肺活量': {'成绩': '2106.0 毫升', '得分': '0'}, '选择反应时': {'成绩': '0.665 秒', '得分': '1'}, '握力': {'成绩': '45.2 千克', '得分': '3'}} \n", + "\n", + "2053 {'name': '韩海涛', 'unit': '水务运行部', 'sex': '男', 'birth': '1971-2-1', '肺活量': {'成绩': '2414.0 毫升', '得分': '2'}, '握力': {'成绩': '38.8 千克', '得分': '2'}, '选择反应时': {'成绩': '0.591 秒', '得分': '3'}} \n", + "\n", + "2356 {'name': '张义生', 'unit': '编组站', 'sex': '男', 'birth': '1981-7-1', '肺活量': {'成绩': '1904.0 毫升', '得分': '0'}, '握力': {'成绩': '39.8 千克', '得分': '2'}, '选择反应时': {'成绩': '0.553 秒', '得分': '3'}} \n", + "\n", + "1974 {'name': '鲍英杰', 'unit': '热电运行部', 'sex': '男', 'birth': '1979-8-1', '肺活量': {'成绩': '4006.0 毫升', '得分': '4'}} \n", + "\n", + "1987 {'name': '贾宁', 'unit': '热电运行部', 'sex': '男', 'birth': '1979-1-1', '握力': {'成绩': '46.3 千克', '得分': '3'}, '单脚站立': {'成绩': '4.2 秒', '得分': '2'}, '选择反应时': {'成绩': '0.592 秒', '得分': '2'}} \n", + "\n" + ] + } + ], + "source": [ + "import json\n", + "import time\n", + "import csv\n", + "import os,sys,shutil\n", + "import glob\n", + "\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "m_path = 'file/2023-04-30'\n", + "old = []\n", + "fls = glob.glob(f'{m_path}/*.pdf')\n", + "for fn in fls:\n", + " #old = os.path.basename(fn).split('.')[0].rjust(8,'0') \n", + " old.append(os.path.basename(fn).split('.')[0])\n", + "for k, v in dict1.items():\n", + " if k not in old and '身高' not in v.keys():\n", + " print(k,v,'\\n')" + ] + }, + { + "cell_type": "markdown", + "id": "54fb3c1b-b791-4502-a78f-89488d329a94", + "metadata": {}, + "source": [ + "### 计算人员年龄" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "70a69705-908f-4c77-948c-c5c781707af5", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T07:18:56.549625Z", + "iopub.status.busy": "2023-05-16T07:18:56.548729Z", + "iopub.status.idle": "2023-05-16T07:18:56.718501Z", + "shell.execute_reply": "2023-05-16T07:18:56.717607Z", + "shell.execute_reply.started": "2023-05-16T07:18:56.549584Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ok\n" + ] + } + ], + "source": [ + "import json\n", + "import datetime\n", + "\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "for k, v in dict1.items():\n", + " birth = v['birth'].split()[0].split('-')\n", + " \n", + " nian = int(birth[0].strip())\n", + " yue = int(birth[1].strip())\n", + " ri = int(birth[2].strip())\n", + " #print(k,nian,yue,ri)\n", + " days = (datetime.date(2023, 4, 23)-datetime.date(nian,yue,ri)).days\n", + " v['age'] = round(days/365)\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'w') as fl:\n", + " json.dump(dict1, fl) \n", + "print('ok') " + ] + }, + { + "cell_type": "markdown", + "id": "a3027c15-aa68-4fb9-9e23-791fa2530209", + "metadata": {}, + "source": [ + "### 汇总人员信息及成绩" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "2c4b4bfc-6112-4e39-9188-32934479952b", + "id": "01a1c350-ae39-4610-b97d-8bcea11cac09", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import json\n", + "\n", + "\n", + "items = ['体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", + "\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "for k,v in dict1.items():\n", + " score = 0\n", + " i = 0\n", + " for k1,v1 in v.items(): \n", + " if k1 in items:\n", + " score = score + int(v1['得分'])\n", + " i+=1\n", + " dict1[k]['score'] = round(score/i,2) \n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'w') as fl:\n", + " json.dump(dict1, fl) \n", + "print('ok')" + ] + }, + { + "cell_type": "markdown", + "id": "3345d0c6-48b5-42c8-98ce-ccb66dd73f87", + "metadata": {}, + "source": [ + "### 计算测试等级" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "id": "69b5f5e5-04e4-4509-8518-b7fc54cd4e45", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T07:57:17.722569Z", + "iopub.status.busy": "2023-05-16T07:57:17.722163Z", + "iopub.status.idle": "2023-05-16T07:57:17.883835Z", + "shell.execute_reply": "2023-05-16T07:57:17.883079Z", + "shell.execute_reply.started": "2023-05-16T07:57:17.722541Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0~255分人数:779人,男性:678人,女性:101人\n", + "256~332分人数:1009人,男性:786人,女性:223人\n", + "333~367分人数:316人,男性:189人,女性:127人\n", + "368~500分人数:129人,男性:57人,女性:72人\n", + "ok\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "dict2 = {}\n", + "dict2['不合格'] = [0,255]\n", + "dict2['合格'] = [256,332]\n", + "dict2['良好'] = [333,367]\n", + "dict2['优秀'] = [368,500]\n", + "\n", + "for k1, v1 in dict2.items():\n", + " di = v1[0]\n", + " gao = v1[1]\n", + " i = 0 \n", + " m = 0\n", + " f = 0\n", + " for k,v in dict1.items():\n", + " if int(v['score']*100) in range(di,gao+1):\n", + " dict1[k]['level'] = k1\n", + " i+=1\n", + " if v['sex'] == '男':\n", + " m = m +1\n", + " else:\n", + " f = f+1\n", + " print(f'{di}~{gao}分人数:{i}人,男性:{m}人,女性:{f}人')\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'w') as fl:\n", + " json.dump(dict1, fl) \n", + "print('ok')" + ] + }, + { + "cell_type": "markdown", + "id": "a87e51a1-e5c1-44c2-bc38-efbe108e92bb", + "metadata": {}, + "source": [ + "### 根据年龄汇总人员信息及成绩" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "id": "cd27296f-2412-4a77-8b74-676c7d0efb30", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T10:12:11.824773Z", + "iopub.status.busy": "2023-05-16T10:12:11.823933Z", + "iopub.status.idle": "2023-05-16T10:12:11.901112Z", + "shell.execute_reply": "2023-05-16T10:12:11.900078Z", + "shell.execute_reply.started": "2023-05-16T10:12:11.824732Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20~24岁平均成绩:2.48分,人数:107人,男性:94人\n", + "25~29岁平均成绩:2.54分,人数:84人,男性:54人\n", + "30~34岁平均成绩:2.69分,人数:204人,男性:159人\n", + "35~39岁平均成绩:2.78分,人数:213人,男性:166人\n", + "40~44岁平均成绩:2.79分,人数:330人,男性:254人\n", + "45~49岁平均成绩:2.84分,人数:449人,男性:278人\n", + "50~54岁平均成绩:2.81分,人数:532人,男性:402人\n", + "55~59岁平均成绩:2.6分,人数:293人,男性:282人\n", + "60~69岁平均成绩:2.5分,人数:21人,男性:21人\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "for item in nld:\n", + " di = item[0]\n", + " gao = item[1]\n", + " i = 1\n", + " score = 0\n", + " m = 0\n", + " f = 0\n", + " for k,v in dict1.items():\n", + " if v['age'] in range(di,gao+1):\n", + " score = score+v['score']\n", + " i+=1\n", + " if v['sex'] == '男':\n", + " m = m +1\n", + " \n", + " print(f'{di}~{gao}岁平均成绩:{round(score/i,2)}分,人数:{i-1}人,男性:{m}人')" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "id": "5dbdf7cf-9014-448a-ba9e-0aea8afbdd6f", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T12:45:45.673845Z", + "iopub.status.busy": "2023-05-16T12:45:45.673313Z", + "iopub.status.idle": "2023-05-16T12:45:45.751891Z", + "shell.execute_reply": "2023-05-16T12:45:45.750835Z", + "shell.execute_reply.started": "2023-05-16T12:45:45.673803Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20~24岁平均成绩:2.46分,人数:94人\n", + "25~29岁平均成绩:2.36分,人数:54人\n", + "30~34岁平均成绩:2.58分,人数:159人\n", + "35~39岁平均成绩:2.7分,人数:166人\n", + "40~44岁平均成绩:2.71分,人数:254人\n", + "45~49岁平均成绩:2.71分,人数:278人\n", + "50~54岁平均成绩:2.69分,人数:402人\n", + "55~59岁平均成绩:2.59分,人数:282人\n", + "60~69岁平均成绩:2.5分,人数:21人\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "for item in nld:\n", + " di = item[0]\n", + " gao = item[1]\n", + " i = 1\n", + " score = 0\n", + " m = 0\n", + " f = 0\n", + " for k,v in dict1.items():\n", + " if v['age'] in range(di,gao+1) and v['sex'] == '男':\n", + " score = score+v['score']\n", + " i+=1\n", + " \n", + " \n", + " print(f'{di}~{gao}岁平均成绩:{round(score/i,2)}分,人数:{i-1}人')" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "id": "cfbb33c5-6740-4226-a792-9ef32e32479e", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T12:47:14.940870Z", + "iopub.status.busy": "2023-05-16T12:47:14.940032Z", + "iopub.status.idle": "2023-05-16T12:47:15.016945Z", + "shell.execute_reply": "2023-05-16T12:47:15.015912Z", + "shell.execute_reply.started": "2023-05-16T12:47:14.940827Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20~24岁平均成绩:2.41分,人数:13人\n", + "25~29岁平均成绩:2.77分,人数:30人\n", + "30~34岁平均成绩:3.02分,人数:45人\n", + "35~39岁平均成绩:2.99分,人数:47人\n", + "40~44岁平均成绩:3.03分,人数:76人\n", + "45~49岁平均成绩:3.02分,人数:171人\n", + "50~54岁平均成绩:3.18分,人数:130人\n", + "55~59岁平均成绩:2.61分,人数:11人\n", + "60~69岁平均成绩:0.0分,人数:0人\n" + ] + } + ], + "source": [ + "import json\n", + "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "for item in nld:\n", + " di = item[0]\n", + " gao = item[1]\n", + " i = 1\n", + " score = 0\n", + " m = 0\n", + " f = 0\n", + " for k,v in dict1.items():\n", + " if v['age'] in range(di,gao+1) and v['sex'] == '女':\n", + " score = score+v['score']\n", + " i+=1\n", + " \n", + " \n", + " print(f'{di}~{gao}岁平均成绩:{round(score/i,2)}分,人数:{i-1}人')" + ] + }, + { + "cell_type": "markdown", + "id": "fc4ba2ba-f4c7-4934-8416-500ffd60e662", + "metadata": {}, + "source": [ + "### 生成平均成绩直方图" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "fb5ccc15-b5bb-4379-88fb-acd8abbe48b6", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T11:00:12.386346Z", + "iopub.status.busy": "2023-05-16T11:00:12.385863Z", + "iopub.status.idle": "2023-05-16T11:00:12.736993Z", + "shell.execute_reply": "2023-05-16T11:00:12.736288Z", + "shell.execute_reply.started": "2023-05-16T11:00:12.386313Z" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "import pygal\n", + "from pygal.style import Style\n", + "\n", + "custom_style = Style(\n", + " colors=('#9BC850', '#ffeb44', '#ff00ff'))\n", + "\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "pjf = []\n", + "for k, v in dict1.items(): \n", + " pjf.append(v['score'])\n", + "pjf.sort()\n", + "bar_chart = pygal.Bar(style=custom_style)\n", + "bar_chart.add('平均分',pjf) # Add some values\n", + "bar_chart.render_to_file('bar_chart.svg') " + ] + }, + { + "cell_type": "markdown", + "id": "8e7a45fc-94d3-468f-853a-e23573333c08", + "metadata": {}, + "source": [ + "### 计算平均成绩" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "id": "41714148-5130-4c83-805f-bb98dbb96dd6", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T11:14:05.569248Z", + "iopub.status.busy": "2023-05-16T11:14:05.568377Z", + "iopub.status.idle": "2023-05-16T11:14:05.634577Z", + "shell.execute_reply": "2023-05-16T11:14:05.633521Z", + "shell.execute_reply.started": "2023-05-16T11:14:05.569202Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "平均成绩:2.6583分,男性:1710人\n", + "平均成绩:3.064分,女性:523人\n", + "平均成绩:2.7533分,女性:2233人\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "i = 1\n", + "m = 0\n", + "f = 0\n", + "score = 0\n", + "t_score = 0\n", + "for k,v in dict1.items():\n", + " if v['sex'] == '男':\n", + " m = m +1\n", + " score = score+v['score']\n", + "print(f'平均成绩:{round(score/m,4)}分,男性:{m}人')\n", + "t_score = t_score + score\n", + "score = 0\n", + "for k,v in dict1.items():\n", + " if v['sex'] == '女':\n", + " f = f +1\n", + " score = score+v['score']\n", + "print(f'平均成绩:{round(score/f,4)}分,女性:{f}人')\n", + "t_score = t_score + score\n", + "print(f'平均成绩:{round(t_score/2233,4)}分,女性:2233人')" + ] + }, + { + "cell_type": "markdown", + "id": "4e854305-a22b-4a0a-a819-988a18424fe7", + "metadata": {}, + "source": [ + "### 计算测试等级" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "id": "de6fbd5b-2361-4207-8bf0-08652148b729", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T11:29:57.182599Z", + "iopub.status.busy": "2023-05-16T11:29:57.182200Z", + "iopub.status.idle": "2023-05-16T11:29:57.360092Z", + "shell.execute_reply": "2023-05-16T11:29:57.359361Z", + "shell.execute_reply.started": "2023-05-16T11:29:57.182571Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0~255分人数:779人,男性:678人,女性:101人\n", + "256~332分人数:1009人,男性:786人,女性:223人\n", + "333~367分人数:316人,男性:189人,女性:127人\n", + "368~500分人数:129人,男性:57人,女性:72人\n", + "ok\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "dict2 = {}\n", + "dict2['不合格'] = [0,255]\n", + "dict2['合格'] = [256,332]\n", + "dict2['良好'] = [333,367]\n", + "dict2['优秀'] = [368,500]\n", + "\n", + "for k1, v1 in dict2.items():\n", + " di = v1[0]\n", + " gao = v1[1]\n", + " i = 0 \n", + " m = 0\n", + " f = 0\n", + " for k,v in dict1.items():\n", + " if int(v['score']*100) in range(di,gao+1):\n", + " dict1[k]['level'] = k1\n", + " i+=1\n", + " if v['sex'] == '男':\n", + " m = m +1\n", + " else:\n", + " f = f+1\n", + " print(f'{di}~{gao}分人数:{i}人,男性:{m}人,女性:{f}人')\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'w') as fl:\n", + " json.dump(dict1, fl) \n", + "print('ok')" + ] + }, + { + "cell_type": "markdown", + "id": "c5b55f21-8f31-4ae7-a75a-4e4bb5faed66", + "metadata": {}, + "source": [ + "### 计算各年龄段测试等级(男)" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "id": "eae7e34f-df88-4d46-bdb2-9f6bf4cfd357", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T11:52:33.551057Z", + "iopub.status.busy": "2023-05-16T11:52:33.550217Z", + "iopub.status.idle": "2023-05-16T11:52:33.628918Z", + "shell.execute_reply": "2023-05-16T11:52:33.627848Z", + "shell.execute_reply.started": "2023-05-16T11:52:33.551014Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20-24 {'不合格': 4, '合格': 9, '良好': 0}\n", + "25-29 {'合格': 13, '优秀': 2, '不合格': 9, '良好': 6}\n", + "30-34 {'不合格': 8, '良好': 13, '合格': 20, '优秀': 4}\n", + "35-39 {'合格': 20, '良好': 13, '不合格': 9, '优秀': 5}\n", + "40-44 {'合格': 31, '不合格': 16, '良好': 17, '优秀': 12}\n", + "45-49 {'优秀': 20, '合格': 67, '良好': 46, '不合格': 38}\n", + "50-54 {'合格': 57, '不合格': 14, '良好': 30, '优秀': 29}\n", + "55-59 {'合格': 6, '不合格': 3, '优秀': 0, '良好': 2}\n", + "60-69 {'合格': 0, '优秀': 0, '不合格': 0, '良好': 0}\n" + ] + } + ], + "source": [ + "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n", + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "dict2 = {}\n", + "dict2['不合格'] = [0,255]\n", + "dict2['合格'] = [256,332]\n", + "dict2['良好'] = [333,367]\n", + "dict2['优秀'] = [368,500]\n", + "dict3 = {}\n", + "for item in nld:\n", + " di = item[0]\n", + " gao = item[1]\n", + " age = f'{di}-{gao}'\n", + " dict3.setdefault(age,{})\n", + " i = 0 \n", + " m = 0\n", + " f = 0\n", + " for k,v in dict1.items():\n", + " if v['age'] in range(di,gao+1): \n", + " dict3[age].setdefault(v['level'],0)\n", + " if v['sex'] == '女':\n", + " dict3[age][v['level']] = dict3[age][v['level']]+1\n", + " \n", + "for k, v in dict3.items():\n", + " print(k,v)" + ] + }, + { + "cell_type": "markdown", + "id": "83a11ed4-127e-497c-a8b0-431c7abb3840", + "metadata": {}, + "source": [ + "### 按照部门计算平均成绩" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "id": "33bfec2f-3f0c-40b3-81f6-cbbc4a0ce4b4", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T11:57:36.714514Z", + "iopub.status.busy": "2023-05-16T11:57:36.713654Z", + "iopub.status.idle": "2023-05-16T11:57:36.798934Z", + "shell.execute_reply": "2023-05-16T11:57:36.797944Z", + "shell.execute_reply.started": "2023-05-16T11:57:36.714470Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "综合办公室(党委办公室) 3.06 22\n", + "销运管理部 2.99 45\n", + "企业管理部(法律事务部) 2.84 12\n", + "合资运行部 2.9 27\n", + "消防支队 2.98 43\n", + "设备工程部 3.0 44\n", + "党群文化部(宣传工团) 2.98 10\n", + "检验计量中心 2.86 185\n", + "发展计划部计划组 3.03 12\n", + "物资采购中心 2.93 55\n", + "炼油运行一部 2.6 112\n", + "审计管理部 2.93 6\n", + "发展计划部发展规划组 2.99 13\n", + "财务管理部 3.03 17\n", + "生产技术部 2.85 37\n", + "党委组织部(资源管理部) 3.24 16\n", + "安全环保部 3.15 26\n", + "储运运行部 2.64 160\n", + "化工运行部 2.74 269\n", + "信息中心 2.95 17\n", + "电气仪表中心 2.86 226\n", + "热电运行部 2.5 91\n", + "炼油运行三部 2.58 140\n", + "行政事务中心 2.49 47\n", + "炼油运行五部 2.78 124\n", + "水务运行部 2.75 135\n", + "编组站 2.44 50\n", + "炼油运行二部 2.68 113\n", + "炼油运行四部 2.67 176\n", + "纪委(监督部) 3.0 3\n" + ] + } + ], + "source": [ + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "depart = []\n", + "for k, v in dict1.items():\n", + " if v['unit'] not in depart:\n", + " depart.append(v['unit'])\n", + "\n", + "for item in depart:\n", + " score = 0\n", + " n = 0\n", + " for k, v in dict1.items():\n", + " if item == v['unit']:\n", + " score = score + v['score']\n", + " n = n +1 \n", + " print(item,round(score/n,2),n)\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "d28e91b4-3556-47a4-81a4-a3d44777e899", + "metadata": {}, + "source": [ + "### 计算各项目成绩" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "id": "1626c578-b38d-435b-8c08-45588cd44096", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T12:15:49.551456Z", + "iopub.status.busy": "2023-05-16T12:15:49.550669Z", + "iopub.status.idle": "2023-05-16T12:15:49.633599Z", + "shell.execute_reply": "2023-05-16T12:15:49.632661Z", + "shell.execute_reply.started": "2023-05-16T12:15:49.551420Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "体重 3.49\n", + "肺活量 3.26\n", + "握力 2.54\n", + "坐位体前屈 3.06\n", + "纵跳 1.9\n", + "俯卧撑 2.39\n", + "一分钟仰卧起坐 3.9\n", + "单脚站立 2.23\n", + "选择反应时 2.9\n", + "台阶指数 3.01\n" + ] + } + ], + "source": [ + "filename = 'data/result_石家庄.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "items = ['体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", + "for item in items:\n", + " score = 0\n", + " n = 0\n", + " for k, v in dict1.items():\n", + " if item in v.keys():\n", + " n = n + 1\n", + " score =score + int(v[item]['得分'])\n", + " print(item,round(score/n,2))" + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "id": "25b5f474-1f2e-4d6b-a6d7-2c0427a9bcbf", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-16T14:14:45.541203Z", + "iopub.status.busy": "2023-05-16T14:14:45.540306Z", + "iopub.status.idle": "2023-05-16T14:14:45.551035Z", + "shell.execute_reply": "2023-05-16T14:14:45.549704Z", + "shell.execute_reply.started": "2023-05-16T14:14:45.541147Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'1': {'name': '齐新', 'phone': '13810412119'}, '2': {'name': '代盼盼', 'phone': '18811016592'}, '7': {'name': '陈建侨', 'phone': '18518668138'}, '8': {'name': '孟琳', 'phone': '13810582314'}, '15': {'name': '赵文静', 'phone': '18612218066'}, '16': {'name': '高艳丽', 'phone': '17746578620'}, '17': {'name': '魏腾飞', 'phone': '18519094064'}, '19': {'name': '杨爽', 'phone': '13911804937'}, '20': {'name': '杨静', 'phone': '15201222908'}, '21': {'name': '王京亚', 'phone': '15210034201'}, '22': {'name': '张笑寒', 'phone': '13811282007'}, '23': {'name': '周海苗', 'phone': '15811323860'}, '24': {'name': '胡颖', 'phone': '15901552680'}, '25': {'name': '孙鑫', 'phone': '15810028607'}, '26': {'name': '徐栋刚', 'phone': '13611378746'}, '27': {'name': '屈俊英', 'phone': '15321996557'}, '28': {'name': '侯然', 'phone': '15811321170'}, '29': {'name': '高梦珊', 'phone': '18310115505'}, '30': {'name': '王璐', 'phone': '18210908699'}, '31': {'name': '赵晨阳', 'phone': '13811750045'}, '32': {'name': '张子娣', 'phone': '13811679953'}, '33': {'name': '张昊翔', 'phone': '13699269376'}, '34': {'name': '霍东林', 'phone': '13701385970'}, '37': {'name': '刘鑫', 'phone': '13120475746'}, '39': {'name': '吴家硕', 'phone': '17600977328'}, '40': {'name': '田征', 'phone': '13552876727'}, '41': {'name': '张静瑶', 'phone': '13681188042'}, '42': {'name': '周维', 'phone': '13683093209'}, '43': {'name': '王芳', 'phone': '13439355291'}, '44': {'name': '刘静', 'phone': '13671067523'}, '45': {'name': '张翠萍', 'phone': '13426307538'}, '46': {'name': '郭晏辰', 'phone': '13522701405'}, '49': {'name': '王亚峰', 'phone': '13691445507'}, '50': {'name': '杨静', 'phone': '13436666818'}, '51': {'name': '刘海云', 'phone': '15011151011'}, '53': {'name': '李丽', 'phone': '13521299700'}, '54': {'name': '余华国', 'phone': '13611383112'}, '58': {'name': '叶红', 'phone': '13699107409'}, '59': {'name': '杨雪', 'phone': '13581675022'}, '60': {'name': '胡宇翔', 'phone': '18612251290'}, '61': {'name': '耿利群', 'phone': '13717616853'}, '62': {'name': '张丽侠', 'phone': '13716114708'}, '63': {'name': '郭萌萌', 'phone': '15811322896'}, '64': {'name': '刘然', 'phone': '13810646725'}, '65': {'name': '王芳', 'phone': '13811152058'}, '66': {'name': '李雪', 'phone': '18201450903'}, '67': {'name': '刘秋红', 'phone': '13581670255'}, '68': {'name': '罗琪', 'phone': '13693021978'}, '69': {'name': '刘影翠', 'phone': '13716611017'}, '70': {'name': '李芳', 'phone': '13720086106'}, '71': {'name': '王红晶', 'phone': '13911385423'}, '72': {'name': '翁田田', 'phone': '15210580711'}, '73': {'name': '宋丹', 'phone': '18610698277'}, '74': {'name': '焦阳', 'phone': '13691376452'}, '76': {'name': '孙科', 'phone': '13381073047'}, '78': {'name': '齐占先', 'phone': '13718162901'}, '79': {'name': '刘成', 'phone': '13901322542'}, '80': {'name': '尹玉岐', 'phone': '13911810030'}, '81': {'name': '祁俊', 'phone': '13911778826'}, '82': {'name': '王超', 'phone': '13691485486'}, '83': {'name': '肖国颖', 'phone': '13552568891'}, '84': {'name': '马欣欢', 'phone': '15901057009'}, '86': {'name': '宋新华', 'phone': '13683673008'}, '87': {'name': '李建坤', 'phone': '15010250252'}, '88': {'name': '李雪萌', 'phone': '13811680197'}, '90': {'name': '莱阳', 'phone': '18210672698'}, '92': {'name': '霍少博', 'phone': '15910351351'}, '93': {'name': '杜劲', 'phone': '13681129230'}, '94': {'name': '殷爽', 'phone': '13501210584'}, '95': {'name': '毛佳', 'phone': '15210691317'}, '96': {'name': '徐韬韫', 'phone': '15901441970'}, '97': {'name': '杨跃超', 'phone': '15910281728'}, '98': {'name': '张举', 'phone': '18610224503'}, '99': {'name': '蔺少华', 'phone': '18600655580'}, '100': {'name': '宁培', 'phone': '13810303077'}, '101': {'name': '朱影', 'phone': '15811174828'}, '102': {'name': '孙然', 'phone': '15810802850'}, '103': {'name': '叶文君', 'phone': '13716840153'}, '104': {'name': '刘旭', 'phone': '13651000624'}, '105': {'name': '闫超阔', 'phone': '18210273718'}, '108': {'name': '王君', 'phone': '13691332722'}, '109': {'name': '张秋瑾', 'phone': '13269560927'}, '110': {'name': '史维维', 'phone': '15010368255'}, '111': {'name': '张泽', 'phone': '15010234727'}, '112': {'name': '孙林', 'phone': '13520752811'}, '113': {'name': '王润生', 'phone': '13261988826'}, '114': {'name': '崔亚菲', 'phone': '13810979122'}, '115': {'name': '李雪娇', 'phone': '15910619124'}, '116': {'name': '柳建军', 'phone': '13011030093'}, '117': {'name': '孙学勇', 'phone': '13520765718'}, '118': {'name': '董兰兰', 'phone': '13910303323'}, '119': {'name': '陈娜', 'phone': '18510337879'}, '120': {'name': '杨帆', 'phone': '18610229696'}, '122': {'name': '张春贤', 'phone': '17310179107'}, '123': {'name': '张立伟', 'phone': '13911285239'}, '124': {'name': '李岩', 'phone': '15810525991'}, '126': {'name': '肖杰', 'phone': '13466726203'}, '127': {'name': '张振宇', 'phone': '15910659316'}, '128': {'name': '汪伟', 'phone': '13911416349'}, '129': {'name': '张晓银', 'phone': '13501239434'}, '130': {'name': '马玉桥', 'phone': '13683207236'}, '131': {'name': '吕灿', 'phone': '13269115851'}, '132': {'name': '于双双', 'phone': '18001370626'}, '133': {'name': '贾鹏', 'phone': '13581577666'}, '134': {'name': '张雪', 'phone': '13910212354'}, '135': {'name': '王迪', 'phone': '19800383262'}, '136': {'name': '兰法坡', 'phone': '13683298902'}, '137': {'name': '陆志刚', 'phone': '13716622494'}, '138': {'name': '张国虎', 'phone': '13651376603'}, '139': {'name': '张学超', 'phone': '13520253719'}, '140': {'name': '康玉林', 'phone': '13552112130'}, '141': {'name': '李满存', 'phone': '13552872968'}, '142': {'name': '赵金义', 'phone': '13366615285'}, '143': {'name': '刘劲松', 'phone': '15010832956'}, '144': {'name': '韩旭', 'phone': '17600988129'}, '147': {'name': '高洪影', 'phone': '13552119586'}, '148': {'name': '刘万凯', 'phone': '13683339037'}, '149': {'name': '王超', 'phone': '13911939930'}, '150': {'name': '张建杰', 'phone': '18511186138'}, '151': {'name': '薛贺', 'phone': '13691358158'}, '152': {'name': '张秀荣', 'phone': '13716648282'}, '153': {'name': '马小英', 'phone': '15910231342'}, '154': {'name': '任任', 'phone': '13910519224'}, '155': {'name': '王燕含', 'phone': '18601126504'}, '156': {'name': '王志博', 'phone': '17610603732'}, '157': {'name': '韦杰友', 'phone': '13521551136'}, '158': {'name': '李文业', 'phone': '13831351283'}, '159': {'name': '李炳忠', 'phone': '15245887158'}, '160': {'name': '李景文', 'phone': '13644589589'}, '161': {'name': '张慧锋', 'phone': '18790630680'}, '162': {'name': '张玉英', 'phone': '18201187087'}, '163': {'name': '魏铁', 'phone': '18500399231'}, '164': {'name': '李龙', 'phone': '18545428957'}, '165': {'name': '鲁丹', 'phone': '15910286571'}, '166': {'name': '王成才', 'phone': '13683325919'}, '167': {'name': '李亮', 'phone': '13021026178'}, '168': {'name': '刘素芳', 'phone': '13718625812'}, '169': {'name': '吕云霞', 'phone': '18901325393'}, '170': {'name': '段苏菲', 'phone': '13041038841'}, '171': {'name': '张泽强', 'phone': '13897829556'}, '172': {'name': '刘会强', 'phone': '13791542068'}, '173': {'name': '张建峰', 'phone': '13897829556'}, '174': {'name': '马东明', 'phone': '13716383150'}, '175': {'name': '李东峰', 'phone': '18811266311'}, '176': {'name': '田佳强', 'phone': '15650768161'}}\n" + ] + } + ], + "source": [ + "filename = 'data/tiangongyuan.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "print(dict1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "178b485e-8ee2-4173-b7f5-fe2e875452ab", "metadata": {}, "outputs": [], "source": [] diff --git a/体测单位/长炼医院.ipynb b/体测单位/长炼医院.ipynb index 4349ccb..16cfe24 100644 --- a/体测单位/长炼医院.ipynb +++ b/体测单位/长炼医院.ipynb @@ -72,15 +72,15 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "id": "4b52477e-926a-44b5-b8a0-20bff98d101d", "metadata": { "execution": { - "iopub.execute_input": "2023-05-11T11:36:58.352138Z", - "iopub.status.busy": "2023-05-11T11:36:58.351483Z", - "iopub.status.idle": "2023-05-11T11:36:58.370663Z", - "shell.execute_reply": "2023-05-11T11:36:58.369617Z", - "shell.execute_reply.started": "2023-05-11T11:36:58.352097Z" + "iopub.execute_input": "2023-05-15T10:43:30.775840Z", + "iopub.status.busy": "2023-05-15T10:43:30.775025Z", + "iopub.status.idle": "2023-05-15T10:43:30.794406Z", + "shell.execute_reply": "2023-05-15T10:43:30.793511Z", + "shell.execute_reply.started": "2023-05-15T10:43:30.775797Z" }, "tags": [] }, @@ -89,8 +89,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "1\n", - "1\n" + "6\n", + "6\n" ] } ], @@ -112,7 +112,7 @@ "filename = 'data/长炼医院人员名单.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "rq = '20230511'\n", + "rq = '20230515'\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", @@ -143,15 +143,15 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 7, "id": "033cc564-4aa9-4e88-b38b-ec62a02b1661", "metadata": { "execution": { - "iopub.execute_input": "2023-05-10T12:20:49.147400Z", - "iopub.status.busy": "2023-05-10T12:20:49.146531Z", - "iopub.status.idle": "2023-05-10T12:20:49.171189Z", - "shell.execute_reply": "2023-05-10T12:20:49.170148Z", - "shell.execute_reply.started": "2023-05-10T12:20:49.147358Z" + "iopub.execute_input": "2023-05-15T10:43:39.337088Z", + "iopub.status.busy": "2023-05-15T10:43:39.336252Z", + "iopub.status.idle": "2023-05-15T10:43:39.361956Z", + "shell.execute_reply": "2023-05-15T10:43:39.360904Z", + "shell.execute_reply.started": "2023-05-15T10:43:39.337046Z" }, "tags": [] }, @@ -160,9 +160,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "2\n", - "2\n", - "12\n" + "6\n", + "6\n", + "18\n" ] } ], @@ -238,15 +238,15 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 8, "id": "2ffa583b-be51-40a8-bb55-de6a89d1a54a", "metadata": { "execution": { - "iopub.execute_input": "2023-05-11T11:37:13.952681Z", - "iopub.status.busy": "2023-05-11T11:37:13.951843Z", - "iopub.status.idle": "2023-05-11T11:37:13.978022Z", - "shell.execute_reply": "2023-05-11T11:37:13.977002Z", - "shell.execute_reply.started": "2023-05-11T11:37:13.952640Z" + "iopub.execute_input": "2023-05-15T10:43:56.982893Z", + "iopub.status.busy": "2023-05-15T10:43:56.982045Z", + "iopub.status.idle": "2023-05-15T10:43:57.010597Z", + "shell.execute_reply": "2023-05-15T10:43:57.009606Z", + "shell.execute_reply.started": "2023-05-15T10:43:56.982852Z" }, "tags": [] },