From c7c9e34af491555b80f3cf2402058dd8072383b6 Mon Sep 17 00:00:00 2001 From: 512song Date: Sun, 14 May 2023 22:21:14 +0800 Subject: [PATCH] 20230514 --- 体测单位/天津石化.ipynb | 144 +++++++++++++++++++++ 体测单位/燕山石化.ipynb | 280 +++++++++++++++++++++++++++++----------- 体测单位/长炼医院.ipynb | 75 +++++++---- 数据处理.ipynb | 73 ++++++++++- 4 files changed, 467 insertions(+), 105 deletions(-) diff --git a/体测单位/天津石化.ipynb b/体测单位/天津石化.ipynb index 9bd878e..012352e 100644 --- a/体测单位/天津石化.ipynb +++ b/体测单位/天津石化.ipynb @@ -904,6 +904,150 @@ "print('ok!')" ] }, + { + "cell_type": "markdown", + "id": "964526bc-9c9c-4b63-9300-67b02d2608f5", + "metadata": {}, + "source": [ + "## 天津人员制卡" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "83f02525-fd26-41ba-8b6a-c3cd584825e6", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-11T05:10:37.412656Z", + "iopub.status.busy": "2023-05-11T05:10:37.412185Z", + "iopub.status.idle": "2023-05-11T05:10:37.519354Z", + "shell.execute_reply": "2023-05-11T05:10:37.518601Z", + "shell.execute_reply.started": "2023-05-11T05:10:37.412628Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "30313733323138300000000000000000 b3c2c7bf000000000000000000000000\n", + "30313733303831310000000000000000 baabc5f4000000000000000000000000\n", + "30313733323637350000000000000000 bcd6b3c9c1fa00000000000000000000\n", + "30313733303638380000000000000000 bfdcc8d9cca900000000000000000000\n", + "30313733313236370000000000000000 c0eeb574000000000000000000000000\n", + "30313733313237380000000000000000 c1f5b8d5000000000000000000000000\n", + "30313733303737390000000000000000 d2a6b2a8000000000000000000000000\n", + "30313733313737390000000000000000 d5c5b7c9000000000000000000000000\n", + "30313733323139350000000000000000 d0cfc1acb6b000000000000000000000\n", + "30313733313234380000000000000000 cdf5b1fed2e500000000000000000000\n", + "30313733313237310000000000000000 cdf5bda8e8b000000000000000000000\n", + "30333134353532350000000000000000 c0eecfe8000000000000000000000000\n", + "30313733303832330000000000000000 c9dbcfa3c7bf00000000000000000000\n", + "30313733313836390000000000000000 c1f5beea000000000000000000000000\n", + "30333137323831350000000000000000 d5c5d3f1d0c200000000000000000000\n", + "30313733313235360000000000000000 c0eeb1f3000000000000000000000000\n", + "30313733313235370000000000000000 b8dfbda8ceb000000000000000000000\n", + "30313733303835320000000000000000 ccc6bbe1d6be00000000000000000000\n", + "30333336323135310000000000000000 c1f5bdf0ceb000000000000000000000\n", + "30313733313938320000000000000000 b8dfbda8c0a400000000000000000000\n", + "30313733313236350000000000000000 d5c5ab7c000000000000000000000000\n", + "30333339313137300000000000000000 cdf5cfb2c1fa00000000000000000000\n", + "30313733313837360000000000000000 cdf5c7bf000000000000000000000000\n", + "30313733313933340000000000000000 c4feceb0000000000000000000000000\n", + "30313733303836350000000000000000 c1f5bae9befc00000000000000000000\n", + "30313733313235310000000000000000 b9f9b3c9d6c700000000000000000000\n", + "30313733313935340000000000000000 c2edbbdbbefd00000000000000000000\n", + "30313733303834390000000000000000 c1f5c7ecd1d200000000000000000000\n", + "30313733313935350000000000000000 c3cfb4ba000000000000000000000000\n", + "30313733313930380000000000000000 d0cfd5f1b5c200000000000000000000\n", + "30313733393733390000000000000000 d5c5c8f3ccef00000000000000000000\n", + "30333339313134330000000000000000 c1f5ccedd6c700000000000000000000\n", + "30313733313237360000000000000000 c1f5bda1000000000000000000000000\n", + "30313733303836320000000000000000 cee2b9f3c3f100000000000000000000\n", + "30313733313831360000000000000000 b2dcbaa3b7e500000000000000000000\n", + "30313733313836360000000000000000 c0eeb8a3cdfa00000000000000000000\n", + "30313733313236390000000000000000 b2ccc1a2d0c200000000000000000000\n", + "30313733303835360000000000000000 bafab3a4c1ac00000000000000000000\n", + "30313733303834380000000000000000 c1f5bdf0bbaa00000000000000000000\n", + "30313733303833320000000000000000 d5d4d6bec3f100000000000000000000\n", + "30313733313939340000000000000000 d0bbbcd1000000000000000000000000\n", + "30313733313833350000000000000000 d3dad1e0000000000000000000000000\n", + "30313733323637380000000000000000 b8dfbea7000000000000000000000000\n", + "30333434303630390000000000000000 c2acbaecc1c100000000000000000000\n", + "30333436383237350000000000000000 d5c5b2a9d3ee00000000000000000000\n", + "30333436383335360000000000000000 d6a3b1bec3f700000000000000000000\n", + "30333436383334310000000000000000 c4c2b1a6c3c000000000000000000000\n", + "30333436383335350000000000000000 d5d4d4bd000000000000000000000000\n", + "30333436383334360000000000000000 d4acc0da000000000000000000000000\n", + "30333436383335340000000000000000 d5d4d3f1bde000000000000000000000\n", + "30333436383332370000000000000000 cdf5d3bed5e900000000000000000000\n", + "30333436383234380000000000000000 b6a1d2bb000000000000000000000000\n", + "30333436383235310000000000000000 baced3a6bfed00000000000000000000\n", + "30333436383331350000000000000000 d1eec8e3e6cc00000000000000000000\n", + "30333433363834360000000000000000 cee2bae1000000000000000000000000\n", + "30333439393435310000000000000000 c1f5c5e0b1f500000000000000000000\n", + "30333439393430300000000000000000 b7bfbaead3ee00000000000000000000\n", + "30333439393336370000000000000000 b8dfbac6bae300000000000000000000\n", + "30333439393437350000000000000000 c1f5cdae000000000000000000000000\n", + "30333439393432300000000000000000 c7d8d1a7c9ad00000000000000000000\n", + "30333439393334390000000000000000 c9eab3ac000000000000000000000000\n", + "30333439393433340000000000000000 b9f9d4aac9fa00000000000000000000\n", + "30333439393335300000000000000000 c5d3bcd1c0d600000000000000000000\n", + "30333439393339340000000000000000 cbd5ccda000000000000000000000000\n", + "30333439393336390000000000000000 c0eeb0c2000000000000000000000000\n", + "30333530353732340000000000000000 d1eebdf0c5f300000000000000000000\n", + "30333530353735300000000000000000 b7b6d6bed2e300000000000000000000\n", + "30333530353733310000000000000000 c0eed4f3b3bf00000000000000000000\n", + "30333530353731360000000000000000 b3c2bcd1e2f900000000000000000000\n", + "30333332313739300000000000000000 bfb5b7b2000000000000000000000000\n", + "ok!\n" + ] + } + ], + "source": [ + "import binascii\n", + "import openpyxl\n", + "gbs = 'C2EDC1A2D1C7'\n", + "bs = binascii.a2b_hex(gbs)\n", + "#print('bs', bs)\n", + "#print('decode-bs:', bs.decode('gb2312'))\n", + "\n", + "s = '马立亚'\n", + "gbcode = s.encode('gb2312') # 先转成 bytes格式\n", + "#print('gbcode:', gbcode)\n", + "gbs = \"\".join([hex(ch)[2:] for ch in gbcode]) #\n", + "#print('gbs:', gbs)\n", + "\n", + "wb = openpyxl.load_workbook('data/联合六车间体质测定人员名单.xlsx')\n", + "sheet = wb.active\n", + "# sheets = wb.sheetnames\n", + "person = {}\n", + "list1 = []\n", + "for n in range(3, sheet.max_row+1):\n", + " name = sheet.cell(n, 3).value\n", + " code = sheet.cell(n, 2).value\n", + " gbcode = code.encode('gbk')\n", + " code = \"\".join([hex(ch)[2:] for ch in gbcode])\n", + " gbcode = name.encode('gbk')\n", + " name = \"\".join([hex(ch)[2:] for ch in gbcode])\n", + " #for s in code:\n", + " # print(ord(s))\n", + " \n", + " list1.append([sheet.cell(n, 1).value,sheet.cell(n, 2).value,sheet.cell(n, 3).value,code.ljust(32,'0'),name.ljust(32,'0')])\n", + " print(code.ljust(32,'0'),name.ljust(32,'0'))\n", + "\n", + "filename = 'data/联合六车间体质测定人员制卡名单.xlsx'\n", + "wb = openpyxl.Workbook()\n", + "sheet = wb.active\n", + "\n", + "for row in list1:\n", + " sheet.append(row)\n", + " \n", + "wb.save(filename)\n", + "print('ok!')\n" + ] + }, { "cell_type": "markdown", "id": "638bbe8e-3770-40e1-b884-ceeeec5a053c", diff --git a/体测单位/燕山石化.ipynb b/体测单位/燕山石化.ipynb index edcbe0e..7c5256d 100644 --- a/体测单位/燕山石化.ipynb +++ b/体测单位/燕山石化.ipynb @@ -10,15 +10,15 @@ }, { "cell_type": "code", - "execution_count": 189, + "execution_count": 20, "id": "1b92b7c5-cb77-49da-95b7-34827ecf1d16", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -27,6 +27,8 @@ "name": "stdout", "output_type": "stream", "text": [ + "8205\n", + "8170\n", "ok\n" ] } @@ -73,6 +75,12 @@ " if sheet.cell(n,12).value is not None:\n", " 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", + "print(len(person))\n", + "for k in jianyuan:\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", @@ -89,15 +97,15 @@ }, { "cell_type": "code", - "execution_count": 190, + "execution_count": 14, "id": "71e1ec6a-6797-4496-969a-1d1461b9ea58", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -106,10 +114,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "399\n", - "999 张术申 已测试!\n", - "399\n", - "5478\n" + "252\n", + "252\n", + "7118\n" ] } ], @@ -132,7 +139,7 @@ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", - "filename = 'data/places_result_20230506.csv'\n", + "filename = 'data/places_result_20230512.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -165,7 +172,7 @@ " else:\n", " for k1,v1 in v.items():\n", " dict2[k][k1] = v1\n", - "filename = 'data/result_燕山石化(20230506).json'\n", + "filename = 'data/result_燕山石化(20230512).json'\n", "with open(filename,'w') as fl:\n", " json.dump(re_ta, fl, ensure_ascii=False) \n", "print(len(re_ta))\n", @@ -185,15 +192,15 @@ }, { "cell_type": "code", - "execution_count": 191, + "execution_count": 15, "id": "c24880ad-bbbd-4ad8-a894-cbcea389e822", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -205,7 +212,7 @@ "items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "\n", - "filename = 'data/result_燕山石化(20230506).json'\n", + "filename = 'data/result_燕山石化(20230512).json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "\n", @@ -230,7 +237,72 @@ " else:\n", " list2.append('') \n", " list1.append(list2)\n", - "filename = 'data/燕山石化体测情况表(20230506).xlsx'\n", + "filename = 'data/燕山石化体测情况表(20230512).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)" + ] + }, + { + "cell_type": "markdown", + "id": "1cd93a0e-8340-4bd0-a8fd-747f149b256d", + "metadata": {}, + "source": [ + "## 总成绩导出" + ] + }, + { + "cell_type": "code", + "execution_count": 198, + "id": "79c9c728-12e9-4107-bc5a-8c3e3d8b64a6", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-08T00:52:23.460649Z", + "iopub.status.busy": "2023-05-08T00:52:23.459824Z", + "iopub.status.idle": "2023-05-08T00:52:25.090804Z", + "shell.execute_reply": "2023-05-08T00:52:25.090044Z", + "shell.execute_reply.started": "2023-05-08T00:52:23.460608Z" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "import json\n", + "import openpyxl\n", + "\n", + "items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", + "title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", + "\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", + "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]['sex'])\n", + " list2.append(dict2[k]['工作单位']) \n", + " list2.append(dict2[k]['车间'])\n", + " list2.append(dict2[k]['班组'])\n", + " for item in items:\n", + " if item in v.keys():\n", + " list2.append(v[item]['成绩']) \n", + " elif item =='name':\n", + " list2.append(v[item])\n", + " else:\n", + " list2.append('') \n", + " list1.append(list2)\n", + "filename = 'data/燕山石化体测情况表(截至20230506).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -250,15 +322,15 @@ }, { "cell_type": "code", - "execution_count": 161, + "execution_count": 16, "id": "68454877-f1fe-4eed-8a48-265e428f892e", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -267,7 +339,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'储运厂工会': 216, '合成树脂厂': 93, '热电厂工会': 31, '合成橡胶厂工会': 34, '检验计量中心工会': 14, '化学品厂工会': 35, '烯烃厂工会': 9, '炼油厂工会': 40, '有机化工厂工会': 4, '机关工会': 2, '行政事务中心(离退中心)工会': 1, '物装中心工会': 1}\n" + "{'合成橡胶厂工会': 55, '热电厂工会': 104, '检验计量中心工会': 58, '合成树脂厂': 2, '炼油厂工会': 26, '有机化工厂工会': 1, '高科公司工会': 1, '储运厂工会': 1, '化学品厂工会': 3, '烯烃厂工会': 1}\n" ] } ], @@ -275,7 +347,7 @@ "import json\n", "import openpyxl\n", "\n", - "filename = 'data/result_燕山石化(20230505).json'\n", + "filename = 'data/result_燕山石化(20230512).json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "dict2 = {}\n", @@ -290,7 +362,7 @@ " list2 = []\n", " list2 = [k,v]\n", " list1.append(list2)\n", - "filename = 'data/燕山石化部门测试人数情况表(20230505).xlsx'\n", + "filename = 'data/燕山石化部门测试人数情况表(20230512).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -367,15 +439,15 @@ }, { "cell_type": "code", - "execution_count": 195, + "execution_count": 23, "id": "eddf7dab-b28d-402a-aeaf-27c120048ecb", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -386,12 +458,12 @@ "\n", "\n", "title = ['编号','姓名','性别','单位','车间','班组']\n", - "filename = 'data/result_燕山石化.json'\n", + "filename = 'data/result_燕山石化-all.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "# 筛选重名剔除名单\n", "chongming = []\n", - "filename = 'data/燕山石化重名人员测试情况(20230506).xlsx'\n", + "filename = 'data/燕山石化重名人员测试情况(20230512).xlsx'\n", "wb = openpyxl.load_workbook(filename)\n", "sheet = wb.active\n", "for n in range(1, sheet.max_row+1,2):\n", @@ -420,14 +492,13 @@ " list2.append(dict2[k]['车间'])\n", " list2.append(dict2[k]['班组'])\n", " list1.append(list2)\n", - "filename = 'data/燕山石化未体测人员名单(截至20230506).xlsx'\n", + "filename = 'data/燕山石化未体测人员名单(截至20230512).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) " + "wb.save(filename)" ] }, { @@ -440,15 +511,15 @@ }, { "cell_type": "code", - "execution_count": 188, + "execution_count": 8, "id": "641863ef-324f-4c33-a0a9-699031afb6f1", "metadata": { "execution": { - "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" + "iopub.execute_input": "2023-05-11T04:50:37.384699Z", + "iopub.status.busy": "2023-05-11T04:50:37.383858Z", + "iopub.status.idle": "2023-05-11T04:50:37.543557Z", + "shell.execute_reply": "2023-05-11T04:50:37.542638Z", + "shell.execute_reply.started": "2023-05-11T04:50:37.384657Z" }, "tags": [] }, @@ -457,7 +528,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "[['4025', '马珺', '教育培训中心工会', '身高,体重,选择反应时'], ['7790', '吴志鹏', '生产运行保障中心', '身高,体重,握力'], ['2349', '王军海', '合成橡胶厂工会', '身高,体重'], ['8151', '赵春先', '合成树脂厂', '身高,体重,握力'], ['7682', '孙宏林', '有机化工厂工会', '肺活量,身高,体重'], ['2004', '刘鹏', '合成树脂厂', '身高,体重,握力'], ['642', '刘小宾', '储运厂工会', '身高,体重,肺活量'], ['3125', '李志斌', '化学品厂工会', '身高,体重,握力']]\n" + "[['4025', '马珺', '教育培训中心工会', '身高,体重,选择反应时'], ['7790', '吴志鹏', '生产运行保障中心', '身高,体重,握力'], ['8151', '赵春先', '合成树脂厂', '身高,体重,握力'], ['7682', '孙宏林', '有机化工厂工会', '肺活量,身高,体重'], ['2004', '刘鹏', '合成树脂厂', '身高,体重,握力'], ['3125', '李志斌', '化学品厂工会', '身高,体重,握力']]\n" ] } ], @@ -467,7 +538,7 @@ "\n", "items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", - "filename = 'data/result_燕山石化.json'\n", + "filename = 'data/result_燕山石化-all.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "\n", @@ -492,7 +563,7 @@ " list2.append(xm)\n", " list1.append(list2)\n", "print(list1)\n", - "filename = 'data/燕山石化测试项目不足人员(截止5月5日).xlsx'\n", + "filename = 'data/燕山石化测试项目不足人员(截止5月11日).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "#sheet.append(title)\n", @@ -512,15 +583,15 @@ }, { "cell_type": "code", - "execution_count": 142, + "execution_count": 21, "id": "b735248a-c1b0-4e90-8df4-37cd7625cb1a", "metadata": { "execution": { - "iopub.execute_input": "2023-04-27T11:19:41.635154Z", - "iopub.status.busy": "2023-04-27T11:19:41.634745Z", - "iopub.status.idle": "2023-04-27T11:19:41.975500Z", - "shell.execute_reply": "2023-04-27T11:19:41.974722Z", - "shell.execute_reply.started": "2023-04-27T11:19:41.635125Z" + "iopub.execute_input": "2023-05-14T14:16:50.290820Z", + "iopub.status.busy": "2023-05-14T14:16:50.290016Z", + "iopub.status.idle": "2023-05-14T14:16:51.077768Z", + "shell.execute_reply": "2023-05-14T14:16:51.076992Z", + "shell.execute_reply.started": "2023-05-14T14:16:50.290789Z" }, "tags": [] }, @@ -529,8 +600,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "3802\n", - "3802\n" + "7117\n", + "7117\n" ] } ], @@ -553,7 +624,7 @@ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", - "filename = 'data/places_result_20230427-all.csv'\n", + "filename = 'data/places_result_20230514.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -649,15 +720,15 @@ }, { "cell_type": "code", - "execution_count": 194, + "execution_count": 22, "id": "5df8eb8f-3594-40be-a491-b4d750bbd554", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -696,7 +767,7 @@ " else:\n", " ce = '否'\n", " list3.append([code,name,unit,ce])\n", - "filename = 'data/燕山石化重名人员测试情况(20230506).xlsx'\n", + "filename = 'data/燕山石化重名人员测试情况(20230512).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "#sheet.append(title)\n", @@ -779,8 +850,73 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 217, "id": "c294db76-adc4-41bf-9ee6-811dde1905e8", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-09T02:59:10.544101Z", + "iopub.status.busy": "2023-05-09T02:59:10.543244Z", + "iopub.status.idle": "2023-05-09T02:59:10.550360Z", + "shell.execute_reply": "2023-05-09T02:59:10.549157Z", + "shell.execute_reply.started": "2023-05-09T02:59:10.544059Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bs b'\\xc2\\xed\\xc1\\xa2\\xd1\\xc7'\n", + "decode-bs: 马立亚\n" + ] + } + ], + "source": [ + "#C2EDC1A2D1C7\n", + "gbs = 'C2EDC1A2D1C7'\n", + "import binascii\n", + "bs = binascii.a2b_hex(gbs)\n", + "print('bs', bs)\n", + "print('decode-bs:', bs.decode('gb2312'))" + ] + }, + { + "cell_type": "code", + "execution_count": 219, + "id": "9924d06a-8753-4856-9ccc-f3d5f8956bb2", + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-09T03:06:42.922674Z", + "iopub.status.busy": "2023-05-09T03:06:42.921808Z", + "iopub.status.idle": "2023-05-09T03:06:42.929473Z", + "shell.execute_reply": "2023-05-09T03:06:42.928345Z", + "shell.execute_reply.started": "2023-05-09T03:06:42.922633Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gbcode: b'\\xc2\\xed\\xc1\\xa2\\xd1\\xc7'\n", + "gbs: c2edc1a2d1c7\n" + ] + } + ], + "source": [ + "s = '马立亚'\n", + "gbcode = s.encode('gb2312') # 先转成 bytes格式\n", + "print('gbcode:', gbcode)\n", + "gbs = \"\".join([hex(ch)[2:] for ch in gbcode]) #\n", + "print('gbs:', gbs)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "930f3a2c-e39b-4d2c-916e-c99588e90274", "metadata": {}, "outputs": [], "source": [] diff --git a/体测单位/长炼医院.ipynb b/体测单位/长炼医院.ipynb index 8eca6a9..4349ccb 100644 --- a/体测单位/长炼医院.ipynb +++ b/体测单位/长炼医院.ipynb @@ -10,15 +10,15 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 19, "id": "3154fc8c-0e91-4cda-ba75-666dc7bbb34d", "metadata": { "execution": { - "iopub.execute_input": "2023-04-26T02:09:17.305567Z", - "iopub.status.busy": "2023-04-26T02:09:17.304661Z", - "iopub.status.idle": "2023-04-26T02:09:17.783758Z", - "shell.execute_reply": "2023-04-26T02:09:17.782874Z", - "shell.execute_reply.started": "2023-04-26T02:09:17.305525Z" + "iopub.execute_input": "2023-05-08T07:53:19.491869Z", + "iopub.status.busy": "2023-05-08T07:53:19.491008Z", + "iopub.status.idle": "2023-05-08T07:53:19.954513Z", + "shell.execute_reply": "2023-05-08T07:53:19.953763Z", + "shell.execute_reply.started": "2023-05-08T07:53:19.491826Z" }, "tags": [] }, @@ -72,15 +72,15 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 4, "id": "4b52477e-926a-44b5-b8a0-20bff98d101d", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -89,8 +89,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "44\n", - "44\n" + "1\n", + "1\n" ] } ], @@ -112,7 +112,7 @@ "filename = 'data/长炼医院人员名单.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "rq = '20230505'\n", + "rq = '20230511'\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,10 +143,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "033cc564-4aa9-4e88-b38b-ec62a02b1661", - "metadata": {}, - "outputs": [], + "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" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "2\n", + "12\n" + ] + } + ], "source": [ "import json\n", "import time\n", @@ -162,11 +181,11 @@ "re_ta = {}\n", "dict1 = {}\n", "list1 = []\n", - "filename = 'data/燕山石化人员名单.json'\n", + "filename = 'data/长炼医院人员名单.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "rq = '20230505'\n", - "filename = f'data/places_result_{rq}.csv'\n", + "#rq = '20230510'\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", @@ -219,15 +238,15 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 5, "id": "2ffa583b-be51-40a8-bb55-de6a89d1a54a", "metadata": { "execution": { - "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" + "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" }, "tags": [] }, @@ -236,7 +255,7 @@ "import json\n", "import openpyxl\n", "\n", - "rq = '20230505'\n", + "#rq = '20230510'\n", "items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n", "filename = f'data/result_长炼医院({rq}).json'\n", diff --git a/数据处理.ipynb b/数据处理.ipynb index b503d48..77f60a9 100644 --- a/数据处理.ipynb +++ b/数据处理.ipynb @@ -114,16 +114,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { + "execution": { + "iopub.execute_input": "2023-05-09T03:14:50.263302Z", + "iopub.status.busy": "2023-05-09T03:14:50.262465Z", + "iopub.status.idle": "2023-05-09T03:14:50.269294Z", + "shell.execute_reply": "2023-05-09T03:14:50.268106Z", + "shell.execute_reply.started": "2023-05-09T03:14:50.263258Z" + }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['气郁组']\n" + ] + } + ], "source": [ "import re\n", "\n", "s = '2022-09-28-《气郁组》-视频学习详情_155229'\n", - "m = re.findall(r'《(.+)》',s)\n" + "m = re.findall(r'《(.+)》',s)\n", + "print(m)" ] }, { @@ -164,6 +180,53 @@ "print(int(days))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 字符串转换" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "execution": { + "iopub.execute_input": "2023-05-12T04:10:03.168210Z", + "iopub.status.busy": "2023-05-12T04:10:03.167782Z", + "iopub.status.idle": "2023-05-12T04:10:03.176045Z", + "shell.execute_reply": "2023-05-12T04:10:03.174828Z", + "shell.execute_reply.started": "2023-05-12T04:10:03.168182Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bs b'\\xc0\\xee\\xb5t'\n", + "decode-bs: 李祎\n", + "gbcode: b'\\xc2\\xed\\xc1\\xa2\\xd1\\xc7'\n", + "gbs: c2edc1a2d1c7\n" + ] + } + ], + "source": [ + "import binascii\n", + "\n", + "gbs = 'C0EEB574'\n", + "bs = binascii.a2b_hex(gbs)\n", + "print('bs', bs)\n", + "print('decode-bs:', bs.decode('gbk'))\n", + "\n", + "s = '马立亚'\n", + "gbcode = s.encode('gbk') # 先转成 bytes格式\n", + "print('gbcode:', gbcode)\n", + "gbs = \"\".join([hex(ch)[2:] for ch in gbcode]) #\n", + "print('gbs:', gbs)" + ] + }, { "cell_type": "markdown", "metadata": { @@ -1411,7 +1474,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1425,7 +1488,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.10.6" } }, "nbformat": 4,