20251119
This commit is contained in:
1 parent
31ddcb887f
commit
4f0f65a076
6 files changed
+1896
-136
No files matched your search
+203
-30
@@ -946,27 +946,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"execution_count": null,
|
||||
"id": "02319955-7fb6-4791-ae45-55b03bdadd54",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-11-17T14:25:08.413467Z",
|
||||
"iopub.status.busy": "2025-11-17T14:25:08.412602Z",
|
||||
"iopub.status.idle": "2025-11-17T14:25:08.498336Z",
|
||||
"shell.execute_reply": "2025-11-17T14:25:08.497785Z",
|
||||
"shell.execute_reply.started": "2025-11-17T14:25:08.413400Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
@@ -1656,7 +1641,7 @@
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/result_镇海2025.json'\n",
|
||||
"filename = 'data/result_北海2025.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -1684,7 +1669,6 @@
|
||||
"for k, v in dict1.items():\n",
|
||||
" list1 = []\n",
|
||||
" mydata = {}\n",
|
||||
" \n",
|
||||
" id = str(k).rjust(8,\"0\")\n",
|
||||
" mydata['unit'] = v['unit']\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
@@ -1709,7 +1693,7 @@
|
||||
" mydata['score'] = round(score/len(mydata['fits']),2)\n",
|
||||
" if len(mydata['fits']) >2:\n",
|
||||
" dict2[str(k)] = mydata\n",
|
||||
"filename = f'data/data_镇海2025.json'\n",
|
||||
"filename = f'data/data_北海炼化2025.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print(len(dict2)) "
|
||||
@@ -1735,7 +1719,7 @@
|
||||
"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_镇海2025.json'\n",
|
||||
"filename = 'data/data_北海炼化2025.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"i = 1\n",
|
||||
@@ -2108,7 +2092,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",
|
||||
@@ -2179,9 +2163,7 @@
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
"\n",
|
||||
"dict3 = {}\n",
|
||||
"\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
@@ -2202,6 +2184,196 @@
|
||||
" print(k1,v1['score'],v1['count'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "422a3a6e-468d-4092-9da0-3692814374ca",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计班次成绩"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 123,
|
||||
"id": "0cec9f15-91dd-49e5-9efd-96b6bac0a86f",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-11-19T06:23:29.245390Z",
|
||||
"iopub.status.busy": "2025-11-19T06:23:29.244814Z",
|
||||
"iopub.status.idle": "2025-11-19T06:23:29.275383Z",
|
||||
"shell.execute_reply": "2025-11-19T06:23:29.274885Z",
|
||||
"shell.execute_reply.started": "2025-11-19T06:23:29.245323Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"白班 3.49 174\n",
|
||||
"倒班 3.35 103\n",
|
||||
"值班 3.4 18\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"items = ['BMI','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数'] \n",
|
||||
"filename = 'data/data_镇海2025.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"banci = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" if v['banci'] not in banci:\n",
|
||||
" banci.append(v['banci'])\n",
|
||||
"\n",
|
||||
"for item in banci:\n",
|
||||
" score = 0\n",
|
||||
" n = 0\n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" if item == v['banci'] and v['sex'] == '女':\n",
|
||||
" score = score + v['score']\n",
|
||||
" n = n +1 \n",
|
||||
" print(item,round(score/n,2),n)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d0266733-3d7a-4903-952b-6ed9a6b45961",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计班次测试等级"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 125,
|
||||
"id": "127016d1-9aba-45bb-8205-4f4f424eb02e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-11-19T06:26:04.003109Z",
|
||||
"iopub.status.busy": "2025-11-19T06:26:04.002545Z",
|
||||
"iopub.status.idle": "2025-11-19T06:26:04.016810Z",
|
||||
"shell.execute_reply": "2025-11-19T06:26:04.015641Z",
|
||||
"shell.execute_reply.started": "2025-11-19T06:26:04.003053Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"白班 97 152 219 36\n",
|
||||
"倒班 76 184 266 70\n",
|
||||
"值班 43 60 61 5\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"items = ['优秀','良好','合格','不合格'] \n",
|
||||
"\n",
|
||||
"dict3 = {}\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" banci = v['banci']\n",
|
||||
" dict3.setdefault(banci,{})\n",
|
||||
" for item in items:\n",
|
||||
" dict3[banci].setdefault(item,0)\n",
|
||||
"\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" banci = v['banci']\n",
|
||||
" #dict3.setdefault(unit,{})\n",
|
||||
" #for item in items:\n",
|
||||
" #dict3[unit].setdefault(v['level'],0)\n",
|
||||
" if v['sex'] =='男':\n",
|
||||
" dict3[banci][v['level']] +=1\n",
|
||||
"for k, v in dict3.items():\n",
|
||||
" print(k,v['优秀'],v['良好'],v['合格'],v['不合格'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 126,
|
||||
"id": "1b2ebf62-9bf6-4c44-b2ec-ed9393c3c355",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-11-19T06:27:20.183814Z",
|
||||
"iopub.status.busy": "2025-11-19T06:27:20.183150Z",
|
||||
"iopub.status.idle": "2025-11-19T06:27:20.228117Z",
|
||||
"shell.execute_reply": "2025-11-19T06:27:20.227481Z",
|
||||
"shell.execute_reply.started": "2025-11-19T06:27:20.183764Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"白班\n",
|
||||
"BMI 2697 677\n",
|
||||
"肺活量 2703 678\n",
|
||||
"握力 1693 678\n",
|
||||
"坐位体前屈 1901 676\n",
|
||||
"纵跳 2435 675\n",
|
||||
"俯卧撑 1978 497\n",
|
||||
"一分钟仰卧起坐 722 169\n",
|
||||
"单脚站立 2003 674\n",
|
||||
"选择反应时 2289 673\n",
|
||||
"台阶指数 1698 667\n",
|
||||
"倒班\n",
|
||||
"BMI 2571 699\n",
|
||||
"肺活量 2727 698\n",
|
||||
"握力 1794 698\n",
|
||||
"坐位体前屈 1852 697\n",
|
||||
"纵跳 2321 697\n",
|
||||
"俯卧撑 2310 586\n",
|
||||
"一分钟仰卧起坐 385 98\n",
|
||||
"单脚站立 1921 693\n",
|
||||
"选择反应时 2273 697\n",
|
||||
"台阶指数 1749 691\n",
|
||||
"值班\n",
|
||||
"BMI 719 187\n",
|
||||
"肺活量 701 187\n",
|
||||
"握力 487 185\n",
|
||||
"坐位体前屈 541 186\n",
|
||||
"纵跳 666 187\n",
|
||||
"俯卧撑 742 168\n",
|
||||
"一分钟仰卧起坐 68 17\n",
|
||||
"单脚站立 534 186\n",
|
||||
"选择反应时 656 187\n",
|
||||
"台阶指数 561 184\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"items = ['BMI','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数'] \n",
|
||||
"filename = 'data/data_镇海2025.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"dict3 = {}\n",
|
||||
"\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" unit = v['banci']\n",
|
||||
" dict3.setdefault(unit,{})\n",
|
||||
" for item in items:\n",
|
||||
" dict3[unit].setdefault(item,{})\n",
|
||||
" dict3[unit][item].setdefault('score',0)\n",
|
||||
" dict3[unit][item].setdefault('count',0)\n",
|
||||
" for k1,v1 in v['fits'].items():\n",
|
||||
" if k1 in items:\n",
|
||||
" dict3[unit][k1]['score']+=v1['score']\n",
|
||||
" dict3[unit][k1]['count']+=1\n",
|
||||
"\n",
|
||||
"for k, v in dict3.items():\n",
|
||||
" print(k)\n",
|
||||
" for k1, v1 in v.items():\n",
|
||||
" print(k1,v1['score'],v1['count'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "bdb81e20-32ec-4e0e-b2ac-13dac2060068",
|
||||
@@ -2584,7 +2756,7 @@
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
|
||||
"filename = 'data/result_新疆油田采油工艺研究院2511.json'\n",
|
||||
"filename = 'data/result_北海2025-1.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"data_list = []\n",
|
||||
@@ -2593,7 +2765,7 @@
|
||||
" list6.append(str(k).rjust(4,'0'))\n",
|
||||
" list6.append(v['name'])\n",
|
||||
" list6.append(v['sex'])\n",
|
||||
" #list6.append(v['unit'])\n",
|
||||
" list6.append(v['unit'])\n",
|
||||
" list6.append(v['age'])\n",
|
||||
" if 'bmi' in v.keys():\n",
|
||||
" bmi = v['bmi']['成绩']\n",
|
||||
@@ -2666,10 +2838,11 @@
|
||||
" list6.append('')\n",
|
||||
" i+=1\n",
|
||||
" data_list.append(list6)\n",
|
||||
"filename = 'data/新疆油田采油工艺研究院情况明细表(202511).xlsx'\n",
|
||||
"filename = 'data/北海炼化情况明细表(2025年).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"title = ['编号', '姓名', '性别', '单位/部门', '年龄', '身高', '体重', 'bmi', '肺活量', '得分', '握力', '得分', '坐位体前屈', '得分', '纵跳', '得分', '俯卧撑', '得分', '单脚站立', '得分', '选择反应时', '得分', '台阶指数', '得分', '一分钟仰卧起坐', '得分', '中医体质', '是否倾向', '平和', '气虚', '阳虚', '阴虚', '痰湿', '湿热', '血瘀', '气郁', '特禀', '成就感', '愉快心理', '放松程度', '压力应对', '体力充沛', '情感充沛度', '颈椎', '胸椎', '腰椎', '骶尾椎']\n",
|
||||
"sheet.append(title)\n",
|
||||
"for row in data_list:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
@@ -2679,7 +2852,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "200d10a8-15a7-4ec9-b407-ffb06c0e19be",
|
||||
"id": "4d77aad2-5ae6-42a6-b5ed-eecefcdbfa50",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
Reference in new issue
Block a user