This commit is contained in:
512song committed 2025-12-22 21:13:47 +08:00
1 parent 6803e6fff6
commit b894e793a5
5 files changed
+1705 -202

No files matched your search

+108 -42
View File
@@ -1632,20 +1632,36 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "46aa847d-e1fe-45bd-85b6-e2d792ec8842",
"metadata": {},
"outputs": [],
"execution_count": 14,
"id": "9ace695e-6a23-44d4-b284-8e8d9805eb81",
"metadata": {
"execution": {
"iopub.execute_input": "2025-12-19T12:50:48.618259Z",
"iopub.status.busy": "2025-12-19T12:50:48.617488Z",
"iopub.status.idle": "2025-12-19T12:50:48.633205Z",
"shell.execute_reply": "2025-12-19T12:50:48.632731Z",
"shell.execute_reply.started": "2025-12-19T12:50:48.618188Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"75\n"
]
}
],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"\n",
"filename = 'data/result_沧州炼化-1.json'\n",
"filename = 'data/result_南京化工(2512)-1.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
" \n",
"\n",
"#items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"items = {}\n",
"items['lung'] = '肺活量'\n",
@@ -1690,10 +1706,11 @@
" 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",
" \n",
" if len(mydata['fits']) >2:\n",
" mydata['score'] = round(score/len(mydata['fits']),2)\n",
" dict2[str(k)] = mydata\n",
"filename = f'data/data_沧州炼化.json'\n",
"filename = f'data/data_南京化工(202512).json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict2,fl , ensure_ascii=False) \n",
"print(len(dict2)) "
@@ -1709,17 +1726,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"id": "63edd636-f034-4aa6-8575-63d5cdb84adb",
"metadata": {
"execution": {
"iopub.execute_input": "2025-12-19T12:51:01.984861Z",
"iopub.status.busy": "2025-12-19T12:51:01.984219Z",
"iopub.status.idle": "2025-12-19T12:51:01.994995Z",
"shell.execute_reply": "2025-12-19T12:51:01.993895Z",
"shell.execute_reply.started": "2025-12-19T12:51:01.984802Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"平均成绩:2.5654分,男性:63人\n",
"平均成绩:2.675分,女性:12人\n",
"平均成绩:2.5829分,总体:75人\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_沧州炼化.json'\n",
"filename = 'data/data_南京化工(202512).json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"i = 1\n",
@@ -1753,12 +1787,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1",
"metadata": {
"execution": {
"iopub.execute_input": "2025-12-19T12:51:42.136559Z",
"iopub.status.busy": "2025-12-19T12:51:42.135934Z",
"iopub.status.idle": "2025-12-19T12:51:42.152707Z",
"shell.execute_reply": "2025-12-19T12:51:42.151634Z",
"shell.execute_reply.started": "2025-12-19T12:51:42.136501Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0~255分人数:33人,男性:31人,女性:2人\n",
"256~332分人数:35人,男性:26人,女性:9人\n",
"333~367分人数:5人,男性:5人,女性:0人\n",
"368~500分人数:2人,男性:1人,女性:1人\n",
"75\n",
"ok\n"
]
}
],
"source": [
"import json\n",
"\n",
@@ -2012,13 +2066,37 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"id": "ad69c45d-3f62-42df-894d-47424e759029",
"metadata": {
"execution": {
"iopub.execute_input": "2025-12-19T12:52:40.178756Z",
"iopub.status.busy": "2025-12-19T12:52:40.178152Z",
"iopub.status.idle": "2025-12-19T12:52:40.184826Z",
"shell.execute_reply": "2025-12-19T12:52:40.184289Z",
"shell.execute_reply.started": "2025-12-19T12:52:40.178722Z"
},
"scrolled": true,
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BMI 1.19 75\n",
"肺活量 3.33 73\n",
"握力 3.39 75\n",
"坐位体前屈 2.29 72\n",
"纵跳 2.29 70\n",
"俯卧撑 2.58 52\n",
"一分钟仰卧起坐 3.67 9\n",
"单脚站立 2.35 75\n",
"选择反应时 3.54 74\n",
"台阶指数 2.2 46\n"
]
}
],
"source": [
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
@@ -2310,15 +2388,15 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 18,
"id": "6f9768ce-2ef5-4253-9fc6-49dbdcf00a19",
"metadata": {
"execution": {
"iopub.execute_input": "2025-12-12T13:17:17.795264Z",
"iopub.status.busy": "2025-12-12T13:17:17.794719Z",
"iopub.status.idle": "2025-12-12T13:17:17.805357Z",
"shell.execute_reply": "2025-12-12T13:17:17.804292Z",
"shell.execute_reply.started": "2025-12-12T13:17:17.795214Z"
"iopub.execute_input": "2025-12-22T11:04:03.470806Z",
"iopub.status.busy": "2025-12-22T11:04:03.470172Z",
"iopub.status.idle": "2025-12-22T11:04:03.479616Z",
"shell.execute_reply": "2025-12-22T11:04:03.479011Z",
"shell.execute_reply.started": "2025-12-22T11:04:03.470775Z"
}
},
"outputs": [],
@@ -2672,35 +2750,23 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 19,
"id": "9ecd3ad8-c8af-4f3e-90e5-1618fea905a4",
"metadata": {
"execution": {
"iopub.execute_input": "2025-12-12T13:46:10.803542Z",
"iopub.status.busy": "2025-12-12T13:46:10.802812Z",
"iopub.status.idle": "2025-12-12T13:46:10.973193Z",
"shell.execute_reply": "2025-12-12T13:46:10.972533Z",
"shell.execute_reply.started": "2025-12-12T13:46:10.803460Z"
"iopub.execute_input": "2025-12-22T11:04:25.639587Z",
"iopub.status.busy": "2025-12-22T11:04:25.638549Z",
"iopub.status.idle": "2025-12-22T11:04:25.677688Z",
"shell.execute_reply": "2025-12-22T11:04:25.677118Z",
"shell.execute_reply.started": "2025-12-22T11:04:25.639534Z"
}
},
"outputs": [
{
"ename": "IndexError",
"evalue": "list index out of range",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[9], line 57\u001b[0m\n\u001b[1;32m 55\u001b[0m psy\u001b[38;5;241m=\u001b[39mv[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpsy_yangmiao_old\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 56\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m26\u001b[39m,\u001b[38;5;241m40\u001b[39m):\n\u001b[0;32m---> 57\u001b[0m new_valve \u001b[38;5;241m=\u001b[39m \u001b[43mpsy\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 58\u001b[0m psy[i] \u001b[38;5;241m=\u001b[39m new_valve\n\u001b[1;32m 59\u001b[0m dict3 \u001b[38;5;241m=\u001b[39m {}\n",
"\u001b[0;31mIndexError\u001b[0m: list index out of range"
]
}
],
"outputs": [],
"source": [
"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",
@@ -2782,7 +2848,7 @@
" list6.append('')\n",
" i+=1\n",
" data_list.append(list6)\n",
"filename = 'data/油田老年大学年度体质复测体质检测明细表(2025年11月).xlsx'\n",
"filename = 'data/新疆油田乒乓球高阶培训班.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"title = ['编号', '姓名', '性别', '单位/部门', '年龄', '身高', '体重', 'bmi', '肺活量', '得分', '握力', '得分', '坐位体前屈', '得分', '纵跳', '得分', '俯卧撑', '得分', '单脚站立', '得分', '选择反应时', '得分', '台阶指数', '得分', '一分钟仰卧起坐', '得分', '中医体质', '是否倾向', '平和', '气虚', '阳虚', '阴虚', '痰湿', '湿热', '血瘀', '气郁', '特禀', '成就感', '愉快心理', '放松程度', '压力应对', '体力充沛', '情感充沛度', '颈椎', '胸椎', '腰椎', '骶尾椎']\n",