From b39962d282b24f1340f240d8723da0d994bcd334 Mon Sep 17 00:00:00 2001 From: 512song Date: Mon, 26 Jan 2026 08:42:05 +0800 Subject: [PATCH] 20260126 --- 体测单位/体质检测数据处理.ipynb | 28 +++++------ 体测单位/通用模板.ipynb | 84 +++++++++++++++++---------------- 2 files changed, 57 insertions(+), 55 deletions(-) diff --git a/体测单位/体质检测数据处理.ipynb b/体测单位/体质检测数据处理.ipynb index 19ffcdd..1069794 100644 --- a/体测单位/体质检测数据处理.ipynb +++ b/体测单位/体质检测数据处理.ipynb @@ -2388,15 +2388,15 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "id": "6f9768ce-2ef5-4253-9fc6-49dbdcf00a19", "metadata": { "execution": { - "iopub.execute_input": "2026-01-22T14:01:06.244749Z", - "iopub.status.busy": "2026-01-22T14:01:06.243759Z", - "iopub.status.idle": "2026-01-22T14:01:06.255504Z", - "shell.execute_reply": "2026-01-22T14:01:06.254604Z", - "shell.execute_reply.started": "2026-01-22T14:01:06.244689Z" + "iopub.execute_input": "2026-01-26T00:23:12.431562Z", + "iopub.status.busy": "2026-01-26T00:23:12.431028Z", + "iopub.status.idle": "2026-01-26T00:23:12.445584Z", + "shell.execute_reply": "2026-01-26T00:23:12.445023Z", + "shell.execute_reply.started": "2026-01-26T00:23:12.431511Z" } }, "outputs": [], @@ -2750,15 +2750,15 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "id": "9ecd3ad8-c8af-4f3e-90e5-1618fea905a4", "metadata": { "execution": { - "iopub.execute_input": "2026-01-22T14:01:37.481771Z", - "iopub.status.busy": "2026-01-22T14:01:37.481188Z", - "iopub.status.idle": "2026-01-22T14:01:37.700702Z", - "shell.execute_reply": "2026-01-22T14:01:37.700220Z", - "shell.execute_reply.started": "2026-01-22T14:01:37.481723Z" + "iopub.execute_input": "2026-01-26T00:23:50.478969Z", + "iopub.status.busy": "2026-01-26T00:23:50.478655Z", + "iopub.status.idle": "2026-01-26T00:23:50.553333Z", + "shell.execute_reply": "2026-01-26T00:23:50.552804Z", + "shell.execute_reply.started": "2026-01-26T00:23:50.478944Z" } }, "outputs": [], @@ -2766,7 +2766,7 @@ "import openpyxl\n", "\n", "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n", - "filename = 'data/result_中心健康检测人员.json'\n", + "filename = 'data/result_物华社区人员.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "data_list = []\n", @@ -2848,7 +2848,7 @@ " list6.append('')\n", " i+=1\n", " data_list.append(list6)\n", - "filename = 'data/中心健康检测人员(20260122).xlsx'\n", + "filename = 'data/物华社区检测人员(20260123).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "title = ['编号', '姓名', '性别', '单位/部门', '年龄', '身高', '体重', 'bmi', '肺活量', '得分', '握力', '得分', '坐位体前屈', '得分', '纵跳', '得分', '俯卧撑', '得分', '单脚站立', '得分', '选择反应时', '得分', '台阶指数', '得分', '一分钟仰卧起坐', '得分', '中医体质', '是否倾向', '平和', '气虚', '阳虚', '阴虚', '痰湿', '湿热', '血瘀', '气郁', '特禀', '成就感', '愉快心理', '放松程度', '压力应对', '体力充沛', '情感充沛度', '颈椎', '胸椎', '腰椎', '骶尾椎']\n", diff --git a/体测单位/通用模板.ipynb b/体测单位/通用模板.ipynb index cbd0f23..e2cfcac 100644 --- a/体测单位/通用模板.ipynb +++ b/体测单位/通用模板.ipynb @@ -10,15 +10,15 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 22, "id": "272aca0e-b70c-46fe-ae58-ad8aaa5b9fa5", "metadata": { "execution": { - "iopub.execute_input": "2026-01-22T13:27:05.690761Z", - "iopub.status.busy": "2026-01-22T13:27:05.690222Z", - "iopub.status.idle": "2026-01-22T13:27:05.710714Z", - "shell.execute_reply": "2026-01-22T13:27:05.710237Z", - "shell.execute_reply.started": "2026-01-22T13:27:05.690707Z" + "iopub.execute_input": "2026-01-26T00:17:22.475278Z", + "iopub.status.busy": "2026-01-26T00:17:22.474637Z", + "iopub.status.idle": "2026-01-26T00:17:22.498993Z", + "shell.execute_reply": "2026-01-26T00:17:22.498203Z", + "shell.execute_reply.started": "2026-01-26T00:17:22.475218Z" } }, "outputs": [ @@ -26,7 +26,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "48 ok\n" + "30 ok\n" ] } ], @@ -35,7 +35,7 @@ "import json\n", "\n", "\n", - "wb = openpyxl.load_workbook('data/中心健康检测人员.xlsx',data_only=True)\n", + "wb = openpyxl.load_workbook('data/物华社区人员名单.xlsx',data_only=True)\n", "sheet = wb.active\n", "# sheets = wb.sheetnames\n", "person = {}\n", @@ -46,11 +46,13 @@ " dict1 = {}\n", " dict1['name'] = sheet.cell(n, 2).value\n", " dict1['sex'] = sheet.cell(n, 3).value\n", - " \n", - " dict1['unit'] = sheet.cell(n, 4).value\n", + " if sheet.cell(n, 4).value is not None:\n", + " dict1['unit'] = sheet.cell(n, 4).value\n", + " else:\n", + " dict1['unit'] = ''\n", " dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0] \n", " person[code] = dict1\n", - "filename = 'data/中心健康检测人员.json'\n", + "filename = 'data/物华社区人员.json'\n", "with open(filename, 'w') as fl:\n", " json.dump(person, fl, ensure_ascii=False)\n", "print(len(person),'ok')" @@ -118,15 +120,15 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 23, "id": "32ef3c92-8644-4421-a9dd-8ae901cb2710", "metadata": { "execution": { - "iopub.execute_input": "2026-01-22T13:30:00.421898Z", - "iopub.status.busy": "2026-01-22T13:30:00.420630Z", - "iopub.status.idle": "2026-01-22T13:30:00.440823Z", - "shell.execute_reply": "2026-01-22T13:30:00.439903Z", - "shell.execute_reply.started": "2026-01-22T13:30:00.421820Z" + "iopub.execute_input": "2026-01-26T00:20:02.929642Z", + "iopub.status.busy": "2026-01-26T00:20:02.929123Z", + "iopub.status.idle": "2026-01-26T00:20:02.939997Z", + "shell.execute_reply": "2026-01-26T00:20:02.939492Z", + "shell.execute_reply.started": "2026-01-26T00:20:02.929607Z" } }, "outputs": [ @@ -134,7 +136,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "29\n" + "30\n" ] } ], @@ -147,11 +149,11 @@ "\n", "re_ta = {}\n", "list1 = []\n", - "filename = 'data/中心健康检测人员.json'\n", + "filename = 'data/物华社区人员.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", - "filename = 'data/marks_20260122.csv'\n", + "filename = 'data/marks_20260126.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -189,7 +191,7 @@ " score = result[4] \n", " re_ta[user][item_name]['成绩'] = score\n", "\n", - "filename = 'data/result_中心健康检测人员.json'\n", + "filename = 'data/result_物华社区人员.json'\n", "with open(filename,'w') as fl:\n", " json.dump(re_ta, fl, ensure_ascii=False) \n", "print(len(re_ta))" @@ -205,15 +207,15 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 24, "id": "728c6978-bc53-44e4-b986-a13d5e2cd889", "metadata": { "execution": { - "iopub.execute_input": "2026-01-22T13:30:37.706987Z", - "iopub.status.busy": "2026-01-22T13:30:37.706464Z", - "iopub.status.idle": "2026-01-22T13:30:37.725209Z", - "shell.execute_reply": "2026-01-22T13:30:37.724253Z", - "shell.execute_reply.started": "2026-01-22T13:30:37.706936Z" + "iopub.execute_input": "2026-01-26T00:20:19.361876Z", + "iopub.status.busy": "2026-01-26T00:20:19.361616Z", + "iopub.status.idle": "2026-01-26T00:20:19.369408Z", + "shell.execute_reply": "2026-01-26T00:20:19.368888Z", + "shell.execute_reply.started": "2026-01-26T00:20:19.361855Z" } }, "outputs": [ @@ -221,7 +223,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "ok! 29\n" + "ok! 30\n" ] } ], @@ -232,7 +234,7 @@ "\n", "#list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','height','weight']\n", "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n", - "filename = 'data/result_中心健康检测人员.json'\n", + "filename = 'data/result_物华社区人员.json'\n", "with open(filename,'r') as fl:\n", " dict2 = json.load(fl) \n", "for k, v in dict2.items():\n", @@ -255,7 +257,7 @@ " dict2[k][item_en]['score'] = My.cal_score(data1)\n", " #print(k,v[item_en]['成绩'],cal_score(data1))\n", "\n", - "filename = 'data/result_中心健康检测人员.json'\n", + "filename = 'data/result_物华社区人员.json'\n", "with open(filename,'w') as fl:\n", " json.dump(dict2,fl , ensure_ascii=False) \n", "print('ok!',len(dict2)) " @@ -300,7 +302,7 @@ "\n", "dict1 = {}\n", "\n", - "filename = 'data/result_中心健康检测人员.json'\n", + "filename = 'data/result_物华社区人员.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "\n", @@ -353,15 +355,15 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 25, "id": "d451cce5-e3a3-4909-bd13-807ddf82059a", "metadata": { "execution": { - "iopub.execute_input": "2026-01-22T13:55:59.725677Z", - "iopub.status.busy": "2026-01-22T13:55:59.725108Z", - "iopub.status.idle": "2026-01-22T13:56:14.228014Z", - "shell.execute_reply": "2026-01-22T13:56:14.226903Z", - "shell.execute_reply.started": "2026-01-22T13:55:59.725621Z" + "iopub.execute_input": "2026-01-26T00:22:27.314429Z", + "iopub.status.busy": "2026-01-26T00:22:27.313838Z", + "iopub.status.idle": "2026-01-26T00:22:41.731103Z", + "shell.execute_reply": "2026-01-26T00:22:41.730020Z", + "shell.execute_reply.started": "2026-01-26T00:22:27.314373Z" } }, "outputs": [ @@ -369,7 +371,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "29\n" + "30\n" ] } ], @@ -382,11 +384,11 @@ "headers = {\n", " \"Content-Type\": \"application/json; charset=UTF-8\"\n", " }\n", - "filename = 'data/result_中心健康检测人员.json'\n", + "filename = 'data/result_物华社区人员.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "list1 = []\n", - "file_path ='./中心健康检测/'\n", + "file_path ='./物华社区/'\n", "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n", "i=0\n", "list2 = []\n", @@ -396,7 +398,7 @@ " \n", " id = str(k).rjust(4,\"0\")\n", " mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n", - " mydata['title'] = '中心健康体质检测'\n", + " mydata['title'] = '物华社区'\n", " mydata['subtitle'] = v['unit']\n", " mydata['id'] = id\n", " mydata['name'] = v['name']\n",