diff --git a/体测单位/体质检测数据处理.ipynb b/体测单位/体质检测数据处理.ipynb index 910837c..6c3c685 100644 --- a/体测单位/体质检测数据处理.ipynb +++ b/体测单位/体质检测数据处理.ipynb @@ -637,12 +637,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "b123ee6b-85d2-4660-b226-321832a6b796", "metadata": { + "execution": { + "iopub.execute_input": "2024-12-05T01:54:15.911722Z", + "iopub.status.busy": "2024-12-05T01:54:15.910983Z", + "iopub.status.idle": "2024-12-05T02:00:21.680493Z", + "shell.execute_reply": "2024-12-05T02:00:21.679283Z", + "shell.execute_reply.started": "2024-12-05T01:54:15.911657Z" + }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "738\n" + ] + } + ], "source": [ "import requests\n", "import json\n", @@ -652,11 +667,11 @@ "headers = {\n", " \"Content-Type\": \"application/json; charset=UTF-8\"\n", " }\n", - "filename = 'data/result_天津2024(部门).json'\n", + "filename = 'data/result_北海炼化2024.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "list1 = []\n", - "file_path ='./天津石化2024/'\n", + "file_path ='./北海炼化2024/'\n", "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n", "i=0\n", "list2 = []\n", @@ -666,8 +681,8 @@ " \n", " id = str(k).rjust(4,\"0\")\n", " mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n", - " mydata['title'] = '中石化(天津)石油化工\\n有限公司'\n", - " mydata['subtitle'] = v['unit']+' '+v['sub_unit']\n", + " mydata['title'] = '中国石化北海炼化有限责任公司'\n", + " mydata['subtitle'] = v['unit']\n", " mydata['id'] = id\n", " mydata['name'] = v['name']\n", " if v['sex'] == '男':\n", @@ -839,7 +854,7 @@ "from pathlib import Path\n", "import openpyxl\n", "\n", - "fi_path = '/home/songyi/pdf-typescript/中安联合'\n", + "fi_path = '/home/songyi/pdf-typescript/北海炼化2024'\n", "\n", "filename = 'data/中安联合.json'\n", "with open(filename,'r') as fl:\n", @@ -869,12 +884,61 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "id": "849ccf0c-374c-4915-98ae-78156203ed59", + "cell_type": "markdown", + "id": "34ef7e0d-35ea-4739-a1cb-540c5039afb7", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "## 检查报告错误人员" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "c464fa11-8a0d-44e9-8af0-8c1f50263ceb", + "metadata": { + "execution": { + "iopub.execute_input": "2024-12-05T02:12:16.971166Z", + "iopub.status.busy": "2024-12-05T02:12:16.970399Z", + "iopub.status.idle": "2024-12-05T02:12:16.991930Z", + "shell.execute_reply": "2024-12-05T02:12:16.991373Z", + "shell.execute_reply.started": "2024-12-05T02:12:16.971124Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "739\n", + "518\n", + "275\n", + "809\n" + ] + } + ], + "source": [ + "import os,sys,shutil\n", + "import json\n", + "import glob\n", + "from pathlib import Path\n", + "import openpyxl\n", + "\n", + "fi_path = '/home/songyi/pdf-typescript/北海炼化2024'\n", + "\n", + "filename = 'data/result_北海炼化2024.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "print(len(dict1))\n", + "fls = glob.glob(f'{fi_path}/*.pdf')\n", + "list1 = []\n", + "for fn in fls: \n", + " fi_name =Path(fn).stem.split('-')[0] \n", + " code = int(fi_name)\n", + " list1.append(str(code))\n", + "for k, v in dict1.items():\n", + " if k not in list1:\n", + " print(k)" + ] }, { "cell_type": "markdown", @@ -1577,15 +1641,15 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 2, "id": "63edd636-f034-4aa6-8575-63d5cdb84adb", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T11:54:26.112966Z", - "iopub.status.busy": "2024-11-07T11:54:26.112213Z", - "iopub.status.idle": "2024-11-07T11:54:26.160290Z", - "shell.execute_reply": "2024-11-07T11:54:26.159716Z", - "shell.execute_reply.started": "2024-11-07T11:54:26.112896Z" + "iopub.execute_input": "2024-12-04T15:02:47.958778Z", + "iopub.status.busy": "2024-12-04T15:02:47.958038Z", + "iopub.status.idle": "2024-12-04T15:02:47.975696Z", + "shell.execute_reply": "2024-12-04T15:02:47.974632Z", + "shell.execute_reply.started": "2024-12-04T15:02:47.958708Z" }, "tags": [] }, @@ -1594,15 +1658,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "平均成绩:2.4229分,男性:2879人\n", - "平均成绩:2.9036分,女性:1180人\n", - "平均成绩:2.5627分,总体:4059人\n" + "平均成绩:2.9551分,男性:598人\n", + "平均成绩:3.1705分,女性:140人\n", + "平均成绩:2.996分,总体:738人\n" ] } ], "source": [ + "import json\n", + "\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", - "filename = 'data/data_天津石化2024.json'\n", + "filename = 'data/data_北海炼化2024.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "i = 1\n", @@ -1636,15 +1702,15 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 3, "id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T11:56:11.605960Z", - "iopub.status.busy": "2024-11-07T11:56:11.605212Z", - "iopub.status.idle": "2024-11-07T11:56:11.779109Z", - "shell.execute_reply": "2024-11-07T11:56:11.778491Z", - "shell.execute_reply.started": "2024-11-07T11:56:11.605889Z" + "iopub.execute_input": "2024-12-04T15:03:47.530784Z", + "iopub.status.busy": "2024-12-04T15:03:47.530057Z", + "iopub.status.idle": "2024-12-04T15:03:47.570098Z", + "shell.execute_reply": "2024-12-04T15:03:47.569570Z", + "shell.execute_reply.started": "2024-12-04T15:03:47.530717Z" }, "tags": [] }, @@ -1653,11 +1719,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "0~255分人数:1925人,男性:1627人,女性:298人\n", - "256~332分人数:1582人,男性:1007人,女性:575人\n", - "333~367分人数:392人,男性:192人,女性:200人\n", - "368~500分人数:160人,男性:53人,女性:107人\n", - "4059\n", + "0~255分人数:130人,男性:116人,女性:14人\n", + "256~332分人数:368人,男性:306人,女性:62人\n", + "333~367分人数:170人,男性:125人,女性:45人\n", + "368~500分人数:70人,男性:51人,女性:19人\n", + "738\n", "ok\n" ] } @@ -1707,15 +1773,15 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 4, "id": "2d661ca6-6129-4da1-ac25-51d0156babb2", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T11:57:31.108486Z", - "iopub.status.busy": "2024-11-07T11:57:31.107793Z", - "iopub.status.idle": "2024-11-07T11:57:31.155952Z", - "shell.execute_reply": "2024-11-07T11:57:31.155372Z", - "shell.execute_reply.started": "2024-11-07T11:57:31.108422Z" + "iopub.execute_input": "2024-12-04T15:04:19.067670Z", + "iopub.status.busy": "2024-12-04T15:04:19.066925Z", + "iopub.status.idle": "2024-12-04T15:04:19.087808Z", + "shell.execute_reply": "2024-12-04T15:04:19.087242Z", + "shell.execute_reply.started": "2024-12-04T15:04:19.067602Z" }, "tags": [] }, @@ -1724,14 +1790,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "20-24 {'合格': 105, '不合格': 70, '良好': 20, '优秀': 4}\n", - "25-29 {'合格': 70, '不合格': 44, '良好': 18, '优秀': 4}\n", - "30-34 {'合格': 26, '不合格': 15, '优秀': 7, '良好': 11}\n", - "35-39 {'不合格': 28, '合格': 63, '良好': 26, '优秀': 16}\n", - "40-44 {'不合格': 23, '良好': 24, '合格': 47, '优秀': 9}\n", - "45-49 {'合格': 156, '不合格': 73, '优秀': 30, '良好': 67}\n", - "50-54 {'合格': 108, '不合格': 45, '良好': 34, '优秀': 37}\n", - "55-80 {'良好': 0, '不合格': 0, '合格': 0, '优秀': 0}\n" + "20-24 {'不合格': 2, '良好': 6, '优秀': 0, '合格': 8}\n", + "25-29 {'良好': 11, '不合格': 2, '合格': 13, '优秀': 2}\n", + "30-34 {'合格': 8, '良好': 3, '优秀': 4, '不合格': 1}\n", + "35-39 {'优秀': 2, '良好': 7, '合格': 10, '不合格': 6}\n", + "40-44 {'优秀': 1, '良好': 4, '合格': 1, '不合格': 0}\n", + "45-49 {'合格': 20, '优秀': 5, '良好': 8, '不合格': 3}\n", + "50-54 {'合格': 2, '良好': 6, '优秀': 5, '不合格': 0}\n", + "55-80 {'优秀': 0, '合格': 0, '良好': 0, '不合格': 0}\n" ] } ], @@ -1774,15 +1840,15 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 7, "id": "fc97df37-34ff-4a02-9d26-b5d81b706e46", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T11:59:17.822639Z", - "iopub.status.busy": "2024-11-07T11:59:17.821878Z", - "iopub.status.idle": "2024-11-07T11:59:17.878973Z", - "shell.execute_reply": "2024-11-07T11:59:17.878408Z", - "shell.execute_reply.started": "2024-11-07T11:59:17.822567Z" + "iopub.execute_input": "2024-12-04T15:07:08.531067Z", + "iopub.status.busy": "2024-12-04T15:07:08.530357Z", + "iopub.status.idle": "2024-12-04T15:07:08.545126Z", + "shell.execute_reply": "2024-12-04T15:07:08.544536Z", + "shell.execute_reply.started": "2024-12-04T15:07:08.531002Z" }, "tags": [] }, @@ -1791,14 +1857,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "20-24 {'合格': 148, '不合格': 264, '良好': 18, '优秀': 4}\n", - "25-29 {'合格': 90, '不合格': 181, '良好': 19, '优秀': 3}\n", - "30-34 {'合格': 34, '不合格': 68, '优秀': 1, '良好': 6}\n", - "35-39 {'不合格': 137, '合格': 95, '良好': 23, '优秀': 5}\n", - "40-44 {'不合格': 76, '良好': 24, '合格': 78, '优秀': 7}\n", - "45-49 {'合格': 112, '不合格': 185, '优秀': 6, '良好': 24}\n", - "50-54 {'合格': 266, '不合格': 407, '良好': 49, '优秀': 19}\n", - "55-80 {'良好': 29, '不合格': 309, '合格': 184, '优秀': 8}\n" + "20-24 {'不合格': 26, '良好': 9, '优秀': 2, '合格': 35}\n", + "25-29 {'良好': 20, '不合格': 25, '合格': 48, '优秀': 3}\n", + "30-34 {'合格': 24, '良好': 5, '优秀': 2, '不合格': 5}\n", + "35-39 {'优秀': 11, '良好': 23, '合格': 29, '不合格': 10}\n", + "40-44 {'优秀': 6, '良好': 3, '合格': 17, '不合格': 1}\n", + "45-49 {'合格': 37, '优秀': 6, '良好': 16, '不合格': 4}\n", + "50-54 {'合格': 73, '良好': 31, '优秀': 12, '不合格': 28}\n", + "55-80 {'优秀': 9, '合格': 43, '良好': 18, '不合格': 17}\n" ] } ], @@ -1841,15 +1907,15 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 8, "id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:00:36.595527Z", - "iopub.status.busy": "2024-11-07T12:00:36.594898Z", - "iopub.status.idle": "2024-11-07T12:00:36.649736Z", - "shell.execute_reply": "2024-11-07T12:00:36.649091Z", - "shell.execute_reply.started": "2024-11-07T12:00:36.595465Z" + "iopub.execute_input": "2024-12-04T15:07:14.121761Z", + "iopub.status.busy": "2024-12-04T15:07:14.119927Z", + "iopub.status.idle": "2024-12-04T15:07:14.142357Z", + "shell.execute_reply": "2024-12-04T15:07:14.141727Z", + "shell.execute_reply.started": "2024-12-04T15:07:14.121677Z" }, "tags": [] }, @@ -1858,14 +1924,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "16~24岁平均成绩:2.46分,人数:633人,男性:434人\n", - "25~29岁平均成绩:2.48分,人数:429人,男性:293人\n", - "30~34岁平均成绩:2.59分,人数:168人,男性:109人\n", - "35~39岁平均成绩:2.66分,人数:393人,男性:260人\n", - "40~44岁平均成绩:2.75分,人数:288人,男性:185人\n", - "45~49岁平均成绩:2.68分,人数:653人,男性:327人\n", - "50~54岁平均成绩:2.57分,人数:965人,男性:741人\n", - "55~69岁平均成绩:2.4分,人数:530人,男性:530人\n" + "16~24岁平均成绩:2.73分,人数:88人,男性:72人\n", + "25~29岁平均成绩:2.92分,人数:124人,男性:96人\n", + "30~34岁平均成绩:3.02分,人数:52人,男性:36人\n", + "35~39岁平均成绩:3.1分,人数:98人,男性:73人\n", + "40~44岁平均成绩:3.21分,人数:33人,男性:27人\n", + "45~49岁平均成绩:3.09分,人数:99人,男性:63人\n", + "50~54岁平均成绩:3.04分,人数:157人,男性:144人\n", + "55~69岁平均成绩:2.97分,人数:87人,男性:87人\n" ] } ], @@ -1903,15 +1969,15 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 10, "id": "347703a1-501b-4800-bd29-16e94f4a6793", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:02:05.653028Z", - "iopub.status.busy": "2024-11-07T12:02:05.651478Z", - "iopub.status.idle": "2024-11-07T12:02:05.696252Z", - "shell.execute_reply": "2024-11-07T12:02:05.695601Z", - "shell.execute_reply.started": "2024-11-07T12:02:05.652939Z" + "iopub.execute_input": "2024-12-04T15:10:04.572147Z", + "iopub.status.busy": "2024-12-04T15:10:04.571454Z", + "iopub.status.idle": "2024-12-04T15:10:04.596383Z", + "shell.execute_reply": "2024-12-04T15:10:04.595277Z", + "shell.execute_reply.started": "2024-12-04T15:10:04.572082Z" }, "tags": [] }, @@ -1920,14 +1986,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "20~24岁平均成绩:2.36分,人数:434人\n", - "25~29岁平均成绩:2.36分,人数:293人\n", - "30~34岁平均成绩:2.38分,人数:109人\n", - "35~39岁平均成绩:2.51分,人数:260人\n", - "40~44岁平均成绩:2.63分,人数:185人\n", - "45~49岁平均成绩:2.41分,人数:327人\n", - "50~54岁平均成绩:2.43分,人数:741人\n", - "55~80岁平均成绩:2.4分,人数:530人\n" + "20~24岁平均成绩:2.68分,人数:72人\n", + "25~29岁平均成绩:2.86分,人数:96人\n", + "30~34岁平均成绩:2.94分,人数:36人\n", + "35~39岁平均成绩:3.12分,人数:73人\n", + "40~44岁平均成绩:3.15分,人数:27人\n", + "45~49岁平均成绩:3.06分,人数:63人\n", + "50~54岁平均成绩:2.98分,人数:144人\n", + "55~80岁平均成绩:2.97分,人数:87人\n" ] } ], @@ -1965,15 +2031,15 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 9, "id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:03:03.848701Z", - "iopub.status.busy": "2024-11-07T12:03:03.848001Z", - "iopub.status.idle": "2024-11-07T12:03:03.906466Z", - "shell.execute_reply": "2024-11-07T12:03:03.905829Z", - "shell.execute_reply.started": "2024-11-07T12:03:03.848635Z" + "iopub.execute_input": "2024-12-04T15:09:34.523177Z", + "iopub.status.busy": "2024-12-04T15:09:34.522550Z", + "iopub.status.idle": "2024-12-04T15:09:34.543633Z", + "shell.execute_reply": "2024-12-04T15:09:34.542960Z", + "shell.execute_reply.started": "2024-12-04T15:09:34.523123Z" }, "tags": [] }, @@ -1982,13 +2048,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "20~24岁平均成绩:2.69分,人数:199人\n", - "25~29岁平均成绩:2.74分,人数:136人\n", - "30~34岁平均成绩:2.96分,人数:59人\n", - "35~39岁平均成绩:2.97分,人数:133人\n", - "40~44岁平均成绩:2.96分,人数:103人\n", - "45~49岁平均成绩:2.96分,人数:326人\n", - "50~54岁平均成绩:3.03分,人数:224人\n", + "20~24岁平均成绩:2.94分,人数:16人\n", + "25~29岁平均成绩:3.13分,人数:28人\n", + "30~34岁平均成绩:3.19分,人数:16人\n", + "35~39岁平均成绩:3.07分,人数:25人\n", + "40~44岁平均成绩:3.49分,人数:6人\n", + "45~49岁平均成绩:3.15分,人数:36人\n", + "50~54岁平均成绩:3.64分,人数:13人\n", "55~80岁平均成绩:0分,人数:0人\n" ] } @@ -2025,15 +2091,15 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 11, "id": "ad69c45d-3f62-42df-894d-47424e759029", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:03:50.847771Z", - "iopub.status.busy": "2024-11-07T12:03:50.846994Z", - "iopub.status.idle": "2024-11-07T12:03:50.910690Z", - "shell.execute_reply": "2024-11-07T12:03:50.910134Z", - "shell.execute_reply.started": "2024-11-07T12:03:50.847699Z" + "iopub.execute_input": "2024-12-04T15:10:44.614467Z", + "iopub.status.busy": "2024-12-04T15:10:44.613711Z", + "iopub.status.idle": "2024-12-04T15:10:44.636541Z", + "shell.execute_reply": "2024-12-04T15:10:44.635981Z", + "shell.execute_reply.started": "2024-12-04T15:10:44.614399Z" }, "tags": [] }, @@ -2042,16 +2108,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "BMI 3.4 4044\n", - "肺活量 3.09 3995\n", - "握力 1.3 4005\n", - "坐位体前屈 2.97 3592\n", - "纵跳 1.98 3690\n", - "俯卧撑 2.22 2160\n", - "一分钟仰卧起坐 4.02 771\n", - "单脚站立 2.44 3732\n", - "选择反应时 2.73 4030\n", - "台阶指数 2.76 1547\n" + "BMI 3.6 738\n", + "肺活量 3.38 728\n", + "握力 2.55 737\n", + "坐位体前屈 2.73 699\n", + "纵跳 2.53 692\n", + "俯卧撑 3.29 523\n", + "一分钟仰卧起坐 3.82 109\n", + "单脚站立 2.73 726\n", + "选择反应时 3.32 737\n", + "台阶指数 2.79 540\n" ] } ], @@ -2079,15 +2145,15 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 12, "id": "dcf152e7-bbcc-47d1-9c5f-83854db35412", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:06:22.566290Z", - "iopub.status.busy": "2024-11-07T12:06:22.564608Z", - "iopub.status.idle": "2024-11-07T12:06:22.615761Z", - "shell.execute_reply": "2024-11-07T12:06:22.615219Z", - "shell.execute_reply.started": "2024-11-07T12:06:22.566204Z" + "iopub.execute_input": "2024-12-04T15:12:44.516371Z", + "iopub.status.busy": "2024-12-04T15:12:44.515637Z", + "iopub.status.idle": "2024-12-04T15:12:44.537110Z", + "shell.execute_reply": "2024-12-04T15:12:44.536346Z", + "shell.execute_reply.started": "2024-12-04T15:12:44.516304Z" }, "tags": [] }, @@ -2096,25 +2162,25 @@ "name": "stdout", "output_type": "stream", "text": [ - "炼油部 2.48 1131\n", - "行政事务中心 2.55 17\n", - "烯烃部 2.54 292\n", - "党委党校(培训中心) 2.84 29\n", - "原油储运部 2.52 198\n", - "公司机关 2.64 82\n", - "研究院 2.82 89\n", - "消防支队 2.61 77\n", - "热电部 2.61 366\n", - "信息档案管理中心 2.87 54\n", - "水务部 2.55 303\n", - "化工部 2.57 479\n", - "装备研究院 2.92 39\n", - "化验计量部 2.65 339\n", - "电仪部 2.49 244\n", - "物资采购中心 2.79 51\n", - "聚醚部 2.76 46\n", - "南港烯烃部 2.49 54\n", - "运输销售部 2.54 169\n" + "炼油二部 2.96 136\n", + "公用工程部 2.99 53\n", + "储运部 2.9 101\n", + "炼油一部 3.0 122\n", + "炼油三部 2.92 74\n", + "物资采购中心 3.17 16\n", + "科技发展部 3.0 9\n", + "设备工程部 3.1 19\n", + "检验计量中心 3.02 39\n", + "财务资产部 3.4 12\n", + "党群工作部 3.33 6\n", + "恒大化工 2.98 39\n", + "发展计划部 3.23 8\n", + "安全环保部 2.98 16\n", + "生产技术部(总调度室) 3.03 17\n", + "党委组织部(人力资源部) 3.15 12\n", + "电气仪表中心 2.94 37\n", + "综合管理部 3.21 14\n", + "本部 3.34 8\n" ] } ], @@ -2146,15 +2212,15 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 14, "id": "d1977ca9-bf12-4f09-ae7b-e8af9eaa82f2", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:15:49.489643Z", - "iopub.status.busy": "2024-11-07T12:15:49.488878Z", - "iopub.status.idle": "2024-11-07T12:15:49.540929Z", - "shell.execute_reply": "2024-11-07T12:15:49.540310Z", - "shell.execute_reply.started": "2024-11-07T12:15:49.489570Z" + "iopub.execute_input": "2024-12-04T15:16:38.052997Z", + "iopub.status.busy": "2024-12-04T15:16:38.052411Z", + "iopub.status.idle": "2024-12-04T15:16:38.070279Z", + "shell.execute_reply": "2024-12-04T15:16:38.069338Z", + "shell.execute_reply.started": "2024-12-04T15:16:38.052942Z" } }, "outputs": [ @@ -2162,25 +2228,25 @@ "name": "stdout", "output_type": "stream", "text": [ - "炼油部 2.37 866\n", - "行政事务中心 2.48 11\n", - "烯烃部 2.38 208\n", - "党委党校(培训中心) 2.74 14\n", - "原油储运部 2.41 148\n", - "公司机关 2.43 45\n", - "研究院 2.67 60\n", - "消防支队 2.54 64\n", - "热电部 2.53 306\n", - "信息档案管理中心 2.8 24\n", - "水务部 2.4 218\n", - "化工部 2.42 327\n", - "装备研究院 2.71 21\n", - "化验计量部 2.35 149\n", - "电仪部 2.4 193\n", - "物资采购中心 2.45 23\n", - "聚醚部 2.4 27\n", - "南港烯烃部 2.4 37\n", - "运输销售部 2.43 138\n" + "炼油二部 3.17 13\n", + "公用工程部 3.33 11\n", + "储运部 2.98 6\n", + "炼油一部 3.21 15\n", + "炼油三部 2.82 6\n", + "物资采购中心 3.05 5\n", + "科技发展部 2.67 1\n", + "设备工程部 3.72 2\n", + "检验计量中心 2.97 19\n", + "财务资产部 3.46 10\n", + "党群工作部 3.67 2\n", + "恒大化工 2.98 26\n", + "发展计划部 3.61 5\n", + "安全环保部 3.25 2\n", + "生产技术部(总调度室) 3.67 1\n", + "党委组织部(人力资源部) 3.3 7\n", + "电气仪表中心 3.28 2\n", + "综合管理部 3.42 7\n", + "本部 0 0\n" ] } ], @@ -2196,7 +2262,7 @@ " score = 0\n", " n = 0\n", " for k, v in dict1.items():\n", - " if item == v['unit'] and v['sex'] == '男':\n", + " if item == v['unit'] and v['sex'] == '女':\n", " score = score + v['score']\n", " n = n +1 \n", " if n>0:\n", @@ -2215,15 +2281,15 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 15, "id": "d507c7f7-6a91-4695-b700-5e2f77e6dea3", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:14:25.642028Z", - "iopub.status.busy": "2024-11-07T12:14:25.641288Z", - "iopub.status.idle": "2024-11-07T12:14:25.691163Z", - "shell.execute_reply": "2024-11-07T12:14:25.690591Z", - "shell.execute_reply.started": "2024-11-07T12:14:25.641958Z" + "iopub.execute_input": "2024-12-04T15:17:22.384324Z", + "iopub.status.busy": "2024-12-04T15:17:22.383584Z", + "iopub.status.idle": "2024-12-04T15:17:22.404238Z", + "shell.execute_reply": "2024-12-04T15:17:22.403084Z", + "shell.execute_reply.started": "2024-12-04T15:17:22.384258Z" } }, "outputs": [ @@ -2231,25 +2297,25 @@ "name": "stdout", "output_type": "stream", "text": [ - "炼油部 27 92 395 617\n", - "行政事务中心 1 2 6 8\n", - "烯烃部 13 29 107 143\n", - "党委党校(培训中心) 3 4 13 9\n", - "原油储运部 5 14 78 101\n", - "公司机关 2 11 34 35\n", - "研究院 7 15 39 28\n", - "消防支队 2 10 29 36\n", - "热电部 23 47 136 160\n", - "信息档案管理中心 1 11 28 14\n", - "水务部 15 22 124 142\n", - "化工部 20 42 210 207\n", - "装备研究院 4 5 19 11\n", - "化验计量部 15 36 157 131\n", - "电仪部 3 18 91 132\n", - "物资采购中心 5 11 16 19\n", - "聚醚部 6 5 14 21\n", - "南港烯烃部 1 4 20 29\n", - "运输销售部 7 14 66 82\n" + "炼油二部 14 29 67 26\n", + "公用工程部 8 11 25 9\n", + "储运部 8 25 42 26\n", + "炼油一部 7 27 69 19\n", + "炼油三部 5 11 43 15\n", + "物资采购中心 3 3 9 1\n", + "科技发展部 1 0 7 1\n", + "设备工程部 2 5 10 2\n", + "检验计量中心 4 11 18 6\n", + "财务资产部 3 3 5 1\n", + "党群工作部 2 1 3 0\n", + "恒大化工 3 9 20 7\n", + "发展计划部 1 3 3 1\n", + "安全环保部 1 5 7 3\n", + "生产技术部(总调度室) 2 4 9 2\n", + "党委组织部(人力资源部) 0 5 6 1\n", + "电气仪表中心 1 9 19 8\n", + "综合管理部 4 4 4 2\n", + "本部 1 5 2 0\n" ] } ], @@ -2289,15 +2355,15 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 16, "id": "90bc66cd-9f01-410e-9abc-e6f15ada293f", "metadata": { "execution": { - "iopub.execute_input": "2024-11-07T12:19:03.411081Z", - "iopub.status.busy": "2024-11-07T12:19:03.410347Z", - "iopub.status.idle": "2024-11-07T12:19:03.485846Z", - "shell.execute_reply": "2024-11-07T12:19:03.485281Z", - "shell.execute_reply.started": "2024-11-07T12:19:03.411010Z" + "iopub.execute_input": "2024-12-04T15:19:48.512361Z", + "iopub.status.busy": "2024-12-04T15:19:48.511640Z", + "iopub.status.idle": "2024-12-04T15:19:48.542915Z", + "shell.execute_reply": "2024-12-04T15:19:48.542354Z", + "shell.execute_reply.started": "2024-12-04T15:19:48.512295Z" } }, "outputs": [ @@ -2305,215 +2371,215 @@ "name": "stdout", "output_type": "stream", "text": [ - "炼油部\n", - "BMI 3704 1128\n", - "肺活量 3450 1111\n", - "握力 1463 1115\n", - "坐位体前屈 2890 1023\n", - "纵跳 2119 1040\n", - "俯卧撑 1317 686\n", - "一分钟仰卧起坐 759 196\n", - "单脚站立 2205 1035\n", - "选择反应时 3087 1123\n", - "台阶指数 1333 482\n", - "行政事务中心\n", - "BMI 57 17\n", - "肺活量 41 16\n", - "握力 22 16\n", - "坐位体前屈 49 17\n", - "纵跳 34 17\n", - "俯卧撑 15 9\n", - "一分钟仰卧起坐 28 6\n", - "单脚站立 35 15\n", - "选择反应时 43 17\n", - "台阶指数 39 13\n", - "烯烃部\n", - "BMI 1000 290\n", - "肺活量 875 287\n", - "握力 387 290\n", - "坐位体前屈 737 251\n", - "纵跳 508 250\n", - "俯卧撑 320 153\n", - "一分钟仰卧起坐 215 51\n", - "单脚站立 593 271\n", - "选择反应时 819 291\n", - "台阶指数 312 110\n", - "党委党校(培训中心)\n", - "BMI 111 29\n", - "肺活量 90 26\n", - "握力 31 28\n", - "坐位体前屈 92 27\n", - "纵跳 65 27\n", - "俯卧撑 15 10\n", - "一分钟仰卧起坐 51 13\n", - "单脚站立 74 26\n", - "选择反应时 80 28\n", - "台阶指数 18 5\n", - "原油储运部\n", - "BMI 656 198\n", - "肺活量 594 196\n", - "握力 252 197\n", - "坐位体前屈 491 171\n", - "纵跳 318 181\n", - "俯卧撑 243 108\n", - "一分钟仰卧起坐 152 41\n", - "单脚站立 462 185\n", - "选择反应时 552 197\n", - "台阶指数 203 78\n", - "公司机关\n", - "BMI 314 82\n", - "肺活量 262 81\n", - "握力 77 82\n", - "坐位体前屈 215 74\n", - "纵跳 164 80\n", - "俯卧撑 91 36\n", - "一分钟仰卧起坐 114 28\n", - "单脚站立 208 79\n", - "选择反应时 210 82\n", - "台阶指数 146 53\n", - "研究院\n", - "BMI 333 89\n", - "肺活量 289 86\n", - "握力 126 87\n", - "坐位体前屈 262 82\n", - "纵跳 209 83\n", - "俯卧撑 128 53\n", - "一分钟仰卧起坐 83 21\n", - "单脚站立 223 86\n", - "选择反应时 253 89\n", - "台阶指数 102 34\n", - "消防支队\n", - "BMI 273 77\n", - "肺活量 212 77\n", - "握力 113 77\n", - "坐位体前屈 216 70\n", - "纵跳 106 73\n", - "俯卧撑 149 50\n", - "一分钟仰卧起坐 37 9\n", - "单脚站立 177 65\n", - "选择反应时 234 75\n", - "台阶指数 70 28\n", - "热电部\n", - "BMI 1184 362\n", - "肺活量 1148 364\n", - "握力 506 361\n", - "坐位体前屈 948 312\n", - "纵跳 714 330\n", - "俯卧撑 551 219\n", - "一分钟仰卧起坐 164 40\n", - "单脚站立 858 335\n", - "选择反应时 1012 366\n", - "台阶指数 432 152\n", - "信息档案管理中心\n", - "BMI 218 54\n", - "肺活量 182 53\n", - "握力 62 54\n", - "坐位体前屈 170 49\n", - "纵跳 107 52\n", - "俯卧撑 60 23\n", - "一分钟仰卧起坐 85 21\n", - "单脚站立 155 54\n", - "选择反应时 155 54\n", - "台阶指数 83 30\n", - "水务部\n", - "BMI 1017 303\n", - "肺活量 883 296\n", - "握力 378 298\n", - "坐位体前屈 751 256\n", - "纵跳 547 276\n", - "俯卧撑 383 153\n", - "一分钟仰卧起坐 250 61\n", - "单脚站立 679 279\n", - "选择反应时 822 300\n", - "台阶指数 260 99\n", - "化工部\n", - "BMI 1601 477\n", - "肺活量 1437 473\n", - "握力 568 468\n", - "坐位体前屈 1311 423\n", - "纵跳 867 440\n", - "俯卧撑 572 249\n", - "一分钟仰卧起坐 358 86\n", - "单脚站立 1119 443\n", - "选择反应时 1271 473\n", - "台阶指数 491 166\n", - "装备研究院\n", - "BMI 167 39\n", - "肺活量 124 38\n", - "握力 45 38\n", - "坐位体前屈 115 38\n", - "纵跳 94 36\n", - "俯卧撑 39 17\n", - "一分钟仰卧起坐 47 11\n", - "单脚站立 121 38\n", - "选择反应时 102 39\n", - "台阶指数 34 12\n", - "化验计量部\n", - "BMI 1231 339\n", - "肺活量 1022 333\n", - "握力 435 334\n", - "坐位体前屈 901 295\n", - "纵跳 519 290\n", - "俯卧撑 177 87\n", - "一分钟仰卧起坐 329 84\n", - "单脚站立 828 299\n", - "选择反应时 919 333\n", - "台阶指数 228 86\n", - "电仪部\n", - "BMI 793 243\n", - "肺活量 762 240\n", - "握力 312 244\n", - "坐位体前屈 667 232\n", - "纵跳 407 230\n", - "俯卧撑 358 153\n", - "一分钟仰卧起坐 136 36\n", - "单脚站立 617 237\n", - "选择反应时 590 244\n", - "台阶指数 281 113\n", + "炼油二部\n", + "BMI 444 136\n", + "肺活量 478 134\n", + "握力 365 136\n", + "坐位体前屈 345 130\n", + "纵跳 347 133\n", + "俯卧撑 352 106\n", + "一分钟仰卧起坐 50 12\n", + "单脚站立 356 134\n", + "选择反应时 432 136\n", + "台阶指数 284 102\n", + "公用工程部\n", + "BMI 199 53\n", + "肺活量 190 53\n", + "握力 133 53\n", + "坐位体前屈 138 51\n", + "纵跳 127 52\n", + "俯卧撑 120 39\n", + "一分钟仰卧起坐 33 9\n", + "单脚站立 134 53\n", + "选择反应时 186 53\n", + "台阶指数 101 38\n", + "储运部\n", + "BMI 351 101\n", + "肺活量 321 99\n", + "握力 281 101\n", + "坐位体前屈 245 91\n", + "纵跳 220 91\n", + "俯卧撑 238 80\n", + "一分钟仰卧起坐 10 4\n", + "单脚站立 237 97\n", + "选择反应时 324 100\n", + "台阶指数 163 57\n", + "炼油一部\n", + "BMI 408 122\n", + "肺活量 414 121\n", + "握力 313 122\n", + "坐位体前屈 329 117\n", + "纵跳 298 115\n", + "俯卧撑 327 97\n", + "一分钟仰卧起坐 40 10\n", + "单脚站立 336 120\n", + "选择反应时 393 122\n", + "台阶指数 275 97\n", + "炼油三部\n", + "BMI 262 74\n", + "肺活量 246 72\n", + "握力 186 74\n", + "坐位体前屈 188 72\n", + "纵跳 169 70\n", + "俯卧撑 206 63\n", + "一分钟仰卧起坐 15 5\n", + "单脚站立 185 73\n", + "选择反应时 217 74\n", + "台阶指数 183 59\n", "物资采购中心\n", - "BMI 184 50\n", - "肺活量 150 51\n", - "握力 62 51\n", - "坐位体前屈 128 39\n", - "纵跳 101 43\n", - "俯卧撑 36 15\n", - "一分钟仰卧起坐 90 20\n", - "单脚站立 139 43\n", - "选择反应时 143 51\n", - "台阶指数 49 16\n", - "聚醚部\n", - "BMI 159 45\n", - "肺活量 163 46\n", - "握力 67 43\n", - "坐位体前屈 125 41\n", - "纵跳 84 41\n", - "俯卧撑 53 21\n", - "一分钟仰卧起坐 61 13\n", - "单脚站立 121 44\n", - "选择反应时 122 46\n", - "台阶指数 49 19\n", - "南港烯烃部\n", - "BMI 170 54\n", - "肺活量 170 54\n", - "握力 72 54\n", - "坐位体前屈 163 54\n", - "纵跳 117 53\n", - "俯卧撑 78 32\n", - "一分钟仰卧起坐 42 10\n", - "单脚站立 124 54\n", - "选择反应时 122 54\n", - "台阶指数 34 18\n", - "运输销售部\n", - "BMI 590 168\n", - "肺活量 475 167\n", - "握力 242 168\n", - "坐位体前屈 444 138\n", - "纵跳 226 148\n", - "俯卧撑 214 86\n", - "一分钟仰卧起坐 100 24\n", - "单脚站立 353 144\n", - "选择反应时 463 168\n", - "台阶指数 98 33\n" + "BMI 60 16\n", + "肺活量 50 16\n", + "握力 41 16\n", + "坐位体前屈 54 16\n", + "纵跳 45 16\n", + "俯卧撑 44 11\n", + "一分钟仰卧起坐 21 5\n", + "单脚站立 44 16\n", + "选择反应时 55 16\n", + "台阶指数 36 14\n", + "科技发展部\n", + "BMI 31 9\n", + "肺活量 30 9\n", + "握力 23 9\n", + "坐位体前屈 21 9\n", + "纵跳 26 9\n", + "俯卧撑 19 7\n", + "一分钟仰卧起坐 3 1\n", + "单脚站立 22 9\n", + "选择反应时 38 9\n", + "台阶指数 25 8\n", + "设备工程部\n", + "BMI 87 19\n", + "肺活量 63 19\n", + "握力 45 19\n", + "坐位体前屈 49 18\n", + "纵跳 45 18\n", + "俯卧撑 50 14\n", + "一分钟仰卧起坐 9 2\n", + "单脚站立 54 19\n", + "选择反应时 64 19\n", + "台阶指数 32 13\n", + "检验计量中心\n", + "BMI 153 39\n", + "肺活量 124 39\n", + "握力 80 38\n", + "坐位体前屈 109 35\n", + "纵跳 68 32\n", + "俯卧撑 50 14\n", + "一分钟仰卧起坐 48 13\n", + "单脚站立 111 37\n", + "选择反应时 130 39\n", + "台阶指数 61 23\n", + "财务资产部\n", + "BMI 50 12\n", + "肺活量 44 12\n", + "握力 30 12\n", + "坐位体前屈 33 11\n", + "纵跳 34 12\n", + "俯卧撑 7 2\n", + "一分钟仰卧起坐 22 6\n", + "单脚站立 51 12\n", + "选择反应时 42 12\n", + "台阶指数 16 6\n", + "党群工作部\n", + "BMI 28 6\n", + "肺活量 16 6\n", + "握力 14 6\n", + "坐位体前屈 21 6\n", + "纵跳 17 6\n", + "俯卧撑 15 4\n", + "一分钟仰卧起坐 10 2\n", + "单脚站立 21 6\n", + "选择反应时 21 6\n", + "台阶指数 17 6\n", + "恒大化工\n", + "BMI 157 39\n", + "肺活量 121 38\n", + "握力 89 39\n", + "坐位体前屈 87 35\n", + "纵跳 91 34\n", + "俯卧撑 35 10\n", + "一分钟仰卧起坐 69 19\n", + "单脚站立 105 39\n", + "选择反应时 121 39\n", + "台阶指数 86 29\n", + "发展计划部\n", + "BMI 34 8\n", + "肺活量 24 8\n", + "握力 18 8\n", + "坐位体前屈 24 8\n", + "纵跳 21 8\n", + "俯卧撑 6 3\n", + "一分钟仰卧起坐 22 5\n", + "单脚站立 29 8\n", + "选择反应时 30 8\n", + "台阶指数 18 6\n", + "安全环保部\n", + "BMI 50 16\n", + "肺活量 49 15\n", + "握力 43 16\n", + "坐位体前屈 47 16\n", + "纵跳 41 16\n", + "俯卧撑 38 12\n", + "一分钟仰卧起坐 7 2\n", + "单脚站立 39 16\n", + "选择反应时 62 16\n", + "台阶指数 36 13\n", + "生产技术部(总调度室)\n", + "BMI 63 17\n", + "肺活量 56 17\n", + "握力 46 17\n", + "坐位体前屈 43 17\n", + "纵跳 37 16\n", + "俯卧撑 44 13\n", + "一分钟仰卧起坐 5 1\n", + "单脚站立 54 17\n", + "选择反应时 62 17\n", + "台阶指数 39 15\n", + "党委组织部(人力资源部)\n", + "BMI 44 12\n", + "肺活量 39 12\n", + "握力 29 12\n", + "坐位体前屈 31 11\n", + "纵跳 23 9\n", + "俯卧撑 17 5\n", + "一分钟仰卧起坐 24 6\n", + "单脚站立 36 11\n", + "选择反应时 47 12\n", + "台阶指数 23 9\n", + "电气仪表中心\n", + "BMI 145 37\n", + "肺活量 107 36\n", + "握力 89 37\n", + "坐位体前屈 86 35\n", + "纵跳 92 35\n", + "俯卧撑 106 30\n", + "一分钟仰卧起坐 9 2\n", + "单脚站立 92 37\n", + "选择反应时 133 37\n", + "台阶指数 64 28\n", + "综合管理部\n", + "BMI 56 14\n", + "肺活量 49 14\n", + "握力 31 14\n", + "坐位体前屈 40 13\n", + "纵跳 29 12\n", + "俯卧撑 14 5\n", + "一分钟仰卧起坐 19 5\n", + "单脚站立 47 14\n", + "选择反应时 57 14\n", + "台阶指数 31 10\n", + "本部\n", + "BMI 32 8\n", + "肺活量 36 8\n", + "握力 20 8\n", + "坐位体前屈 18 8\n", + "纵跳 22 8\n", + "俯卧撑 34 8\n", + "一分钟仰卧起坐 0 0\n", + "单脚站立 27 8\n", + "选择反应时 30 8\n", + "台阶指数 19 7\n" ] } ], @@ -2521,11 +2587,11 @@ "import json\n", "\n", "items = ['BMI','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数'] \n", - "filename = 'data/data_天津石化2024.json'\n", + "filename = 'data/data_北海炼化2024.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "\n", - "filename = 'data/天津石化人员2024.json'\n", + "filename = 'data/北海炼化人员2024.json'\n", "with open(filename,'r') as fl:\n", " dict2 = json.load(fl)\n", "dict3 = {}\n", diff --git a/体测单位/北海炼化.ipynb b/体测单位/北海炼化.ipynb index dca5c1e..19865bc 100644 --- a/体测单位/北海炼化.ipynb +++ b/体测单位/北海炼化.ipynb @@ -636,6 +636,7 @@ "cell_type": "markdown", "id": "c103301b-d540-4bf5-861a-0eb2e313e26e", "metadata": { + "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -2182,10 +2183,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "id": "e1a1b329-acf1-4be9-bcf0-736dbe7f8e0b", - "metadata": {}, - "outputs": [], + "metadata": { + "execution": { + "iopub.execute_input": "2024-12-04T14:53:01.181252Z", + "iopub.status.busy": "2024-12-04T14:53:01.180490Z", + "iopub.status.idle": "2024-12-04T14:53:01.243823Z", + "shell.execute_reply": "2024-12-04T14:53:01.243252Z", + "shell.execute_reply.started": "2024-12-04T14:53:01.181166Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "739\n" + ] + } + ], "source": [ "import json\n", "import datetime\n", @@ -2313,10 +2330,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "id": "dd89efe8-13b9-4db8-8c39-2a48888dd635", - "metadata": {}, - "outputs": [], + "metadata": { + "execution": { + "iopub.execute_input": "2024-12-04T14:53:17.474923Z", + "iopub.status.busy": "2024-12-04T14:53:17.474146Z", + "iopub.status.idle": "2024-12-04T14:53:18.915899Z", + "shell.execute_reply": "2024-12-04T14:53:18.915258Z", + "shell.execute_reply.started": "2024-12-04T14:53:17.474853Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ok!\n" + ] + } + ], "source": [ "import json\n", "import time\n", @@ -2524,10 +2557,106 @@ "wb.save(filename)" ] }, + { + "cell_type": "markdown", + "id": "16bf831a-e725-47d4-87bb-0103ae55f8a6", + "metadata": {}, + "source": [ + "## 清理报告数据" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "6d8a345d-39e0-40cd-9bed-ac4e144b426c", + "metadata": { + "execution": { + "iopub.execute_input": "2024-12-04T15:01:40.945578Z", + "iopub.status.busy": "2024-12-04T15:01:40.944820Z", + "iopub.status.idle": "2024-12-04T15:01:40.998222Z", + "shell.execute_reply": "2024-12-04T15:01:40.997687Z", + "shell.execute_reply.started": "2024-12-04T15:01:40.945506Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "738\n", + "ok!\n" + ] + } + ], + "source": [ + "import json\n", + "import openpyxl\n", + "\n", + "\n", + "filename = 'data/result_北海炼化2024.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + " \n", + "#items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", + "items = {}\n", + "items['lung'] = '肺活量'\n", + "items['grip'] ='握力'\n", + "items['flexion'] ='坐位体前屈'\n", + "items['jump'] ='纵跳'\n", + "items['pushup'] ='俯卧撑'\n", + "items['balance'] ='单脚站立'\n", + "items['reaction'] ='选择反应时'\n", + "items['step'] ='台阶指数'\n", + "items['situp'] ='一分钟仰卧起坐'\n", + "items['bmi'] ='BMI'\n", + "\n", + "\n", + "list1 = []\n", + "\n", + "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n", + "i=1\n", + "list2 = []\n", + "dict2 = {}\n", + "for k, v in dict1.items():\n", + " list1 = []\n", + " mydata = {}\n", + " \n", + " id = str(k).rjust(5,\"0\")\n", + " mydata['unit'] = v['unit']\n", + " mydata['name'] = v['name']\n", + " mydata['sex'] = v['sex']\n", + " mydata['month'] = v['month']\n", + " age = int(v['month']/12)\n", + " if age <20:\n", + " mydata['age'] = 20\n", + " else:\n", + " mydata['age'] = int(v['month']/12)\n", + " \n", + " mydata['fits'] = {}\n", + " score = 0\n", + " for item in list_item:\n", + " if item in v.keys():\n", + " if item in ['lung','pushup','step','situp']:\n", + " mark = v[item]['成绩'].split()[0].split('.')[0]\n", + " else:\n", + " mark = v[item]['成绩'].split()[0]\n", + " mydata['fits'][items[item]] = {'mark':mark,'score':v[item]['score']}\n", + " score = score + v[item]['score']\n", + " mydata['score'] = round(score/len(mydata['fits']),2)\n", + " if len(mydata['fits']) >2:\n", + " dict2[str(k)] = mydata\n", + "filename = f'data/data_北海炼化2024.json'\n", + "with open(filename,'w') as fl:\n", + " json.dump(dict2,fl , ensure_ascii=False) \n", + "print(len(dict2))\n", + "print('ok!')" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "a2cce583-323d-4631-a9bd-39052d3cccbf", + "id": "6cba8d5e-92fd-4afd-94d2-0dcf42e2e22e", "metadata": {}, "outputs": [], "source": [] diff --git a/体测单位/长炼医院.ipynb b/体测单位/长炼医院.ipynb index 37cc5a7..40400a8 100644 --- a/体测单位/长炼医院.ipynb +++ b/体测单位/长炼医院.ipynb @@ -2356,6 +2356,54 @@ "print('ok')" ] }, + { + "cell_type": "markdown", + "id": "4451ac02-b5c4-4e6c-88cf-9dd6f2067763", + "metadata": {}, + "source": [ + "## 汇总2023、2024人员" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a6dc8ae7-5a51-4eb1-954e-19c17b6062cd", + "metadata": { + "execution": { + "iopub.execute_input": "2024-12-05T01:26:00.236419Z", + "iopub.status.busy": "2024-12-05T01:26:00.235845Z", + "iopub.status.idle": "2024-12-05T01:26:00.282366Z", + "shell.execute_reply": "2024-12-05T01:26:00.281825Z", + "shell.execute_reply.started": "2024-12-05T01:26:00.236362Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ok\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "filename = 'data/长炼医院人员2024.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "filename = 'data/长炼医院人员名单.json'\n", + "with open(filename,'r') as fl:\n", + " dict2 = json.load(fl) \n", + "\n", + "for k, v in dict2.items():\n", + " dict1[k] = v\n", + "filename = 'data/长炼医院人员2024(汇总).json'\n", + "with open(filename, 'w') as fl:\n", + " json.dump(dict1, fl, ensure_ascii=False)\n", + "print('ok')" + ] + }, { "cell_type": "markdown", "id": "b056832e-049c-40f4-b7e7-adac6976bf77", @@ -2366,15 +2414,15 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "1e2d586e-6ff5-4fd1-a909-278d23e54561", "metadata": { "execution": { - "iopub.execute_input": "2024-09-29T05:14:10.446230Z", - "iopub.status.busy": "2024-09-29T05:14:10.445350Z", - "iopub.status.idle": "2024-09-29T05:14:10.477950Z", - "shell.execute_reply": "2024-09-29T05:14:10.477374Z", - "shell.execute_reply.started": "2024-09-29T05:14:10.446151Z" + "iopub.execute_input": "2024-12-05T01:38:43.355077Z", + "iopub.status.busy": "2024-12-05T01:38:43.354336Z", + "iopub.status.idle": "2024-12-05T01:38:43.429440Z", + "shell.execute_reply": "2024-12-05T01:38:43.428824Z", + "shell.execute_reply.started": "2024-12-05T01:38:43.355007Z" } }, "outputs": [ @@ -2382,8 +2430,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "212\n", - "212\n" + "377\n", + "377\n" ] } ], @@ -2392,7 +2440,7 @@ "import time\n", "import csv\n", "\n", - "filename = '../item.json'\n", + "filename = '../item1.json'\n", "item = {}\n", "unit = {}\n", "with open(filename,'r') as fl:\n", @@ -2402,7 +2450,7 @@ "re_ta = {}\n", "dict1 = {}\n", "list1 = []\n", - "filename = 'data/长炼医院人员2024.json'\n", + "filename = 'data/长炼医院人员2024(汇总).json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", @@ -2444,15 +2492,15 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "64c6e1e3-801c-4573-b78f-5a9e842597a9", "metadata": { "execution": { - "iopub.execute_input": "2024-09-29T05:14:43.182012Z", - "iopub.status.busy": "2024-09-29T05:14:43.181450Z", - "iopub.status.idle": "2024-09-29T05:14:43.242249Z", - "shell.execute_reply": "2024-09-29T05:14:43.241683Z", - "shell.execute_reply.started": "2024-09-29T05:14:43.181959Z" + "iopub.execute_input": "2024-12-05T01:39:11.222107Z", + "iopub.status.busy": "2024-12-05T01:39:11.221349Z", + "iopub.status.idle": "2024-12-05T01:39:11.314666Z", + "shell.execute_reply": "2024-12-05T01:39:11.314133Z", + "shell.execute_reply.started": "2024-12-05T01:39:11.222034Z" } }, "outputs": [], @@ -2467,7 +2515,7 @@ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "\n", - "filename = 'data/长炼医院人员2024.json'\n", + "filename = 'data/长炼医院人员2024(汇总).json'\n", "with open(filename,'r') as fl:\n", " dict2 = json.load(fl)\n", " \n", @@ -2487,7 +2535,7 @@ " else:\n", " list2.append('') \n", " list1.append(list2)\n", - "filename = 'data/长炼医院人员检测情况表(20240720).xlsx'\n", + "filename = 'data/长炼医院人员检测情况表(20240930).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n",