This commit is contained in:
512song committed 2025-11-19 19:44:42 +08:00
1 parent 31ddcb887f
commit 4f0f65a076
6 files changed
+1896 -136

No files matched your search

+85 -21
View File
@@ -2793,9 +2793,7 @@
{
"cell_type": "markdown",
"id": "08bcbf58-4356-4f30-850f-0d0ff0e2528b",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"# 第三次体测(2024年10月)"
]
@@ -3523,15 +3521,15 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 12,
"id": "52de3ba0-f430-444b-87e9-1f13c3e2dcc2",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-17T13:15:52.024202Z",
"iopub.status.busy": "2025-11-17T13:15:52.023733Z",
"iopub.status.idle": "2025-11-17T13:15:52.062303Z",
"shell.execute_reply": "2025-11-17T13:15:52.061818Z",
"shell.execute_reply.started": "2025-11-17T13:15:52.024158Z"
"iopub.execute_input": "2025-11-19T10:29:58.335947Z",
"iopub.status.busy": "2025-11-19T10:29:58.335228Z",
"iopub.status.idle": "2025-11-19T10:29:58.415390Z",
"shell.execute_reply": "2025-11-19T10:29:58.414784Z",
"shell.execute_reply.started": "2025-11-19T10:29:58.335884Z"
}
},
"outputs": [
@@ -3539,7 +3537,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"253\n"
"1138\n"
]
}
],
@@ -3553,7 +3551,7 @@
"filename = 'data/天津石化人员2025.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/marks_20251117-2.csv'\n",
"filename = 'data/marks_20251119.csv'\n",
"re_ta = My.get_result(filename,dict1)\n",
"\n",
"\n",
@@ -3568,20 +3566,20 @@
"id": "f58f041b-a3cb-475c-8ac2-a8a747c96386",
"metadata": {},
"source": [
"## 统计未体测人员明细表"
"## 统计体测人员明细表"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 13,
"id": "04990b9f-a8f9-4442-935e-d223fde24e72",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-17T13:21:58.571623Z",
"iopub.status.busy": "2025-11-17T13:21:58.570712Z",
"iopub.status.idle": "2025-11-17T13:21:58.620055Z",
"shell.execute_reply": "2025-11-17T13:21:58.619536Z",
"shell.execute_reply.started": "2025-11-17T13:21:58.571556Z"
"iopub.execute_input": "2025-11-19T10:30:02.364463Z",
"iopub.status.busy": "2025-11-19T10:30:02.363762Z",
"iopub.status.idle": "2025-11-19T10:30:02.477779Z",
"shell.execute_reply": "2025-11-19T10:30:02.477220Z",
"shell.execute_reply.started": "2025-11-19T10:30:02.364407Z"
}
},
"outputs": [],
@@ -3601,12 +3599,12 @@
"\n",
"i = 1\n",
"for k, v in dict1.items(): \n",
" list2 = [i,k,v['name'],v['unit']]\n",
" list2 = [i,k,v['name'],v['unit'],dict2[k]['sub_unit']]\n",
" i+=1\n",
" list1.append(list2)\n",
"#print(list1)\n",
"filename = f'data/天津石化体测人员名单(截至20251117).xlsx'\n",
"title = ['序号','员工编号','姓名','部门']\n",
"filename = f'data/天津石化体测人员名单(截至20251119).xlsx'\n",
"title = ['序号','员工编号','姓名','部门','车间']\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
@@ -3615,6 +3613,72 @@
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "ca8b7f16-4654-4117-9e86-6d81ae464bac",
"metadata": {},
"source": [
"## 统计各部门测试情况"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "fcb3c816-5260-4807-9536-b8203680ed1c",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-19T10:23:38.619220Z",
"iopub.status.busy": "2025-11-19T10:23:38.618501Z",
"iopub.status.idle": "2025-11-19T10:23:38.645291Z",
"shell.execute_reply": "2025-11-19T10:23:38.644881Z",
"shell.execute_reply.started": "2025-11-19T10:23:38.619162Z"
}
},
"outputs": [],
"source": [
"import json\n",
"\n",
"filename = 'data/result_天津石化2025.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"filename = 'data/天津石化人员2025.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
"\n",
"dict3 = {}\n",
"for k, v in dict2.items():\n",
" unit = v['unit']\n",
" #sub_unit = v['sub_unit']\n",
" dict3.setdefault(unit,{})\n",
" dict3[unit].setdefault('人数',0)\n",
" dict3[unit].setdefault('体测人数',0)\n",
" #dict3[unit].setdefault(sub_unit,0)\n",
" #dict3[unit][sub_unit] = dict3[unit][sub_unit] + 1\n",
" dict3[unit]['人数'] = dict3[unit]['人数'] + 1\n",
"\n",
"title =['单位','体测人数']\n",
"list1 = []\n",
"for k,v in dict1.items(): \n",
" unit = v['unit']\n",
" #sub_unit = v['sub_unit']\n",
" #dict3[unit][sub_unit] = dict3[unit][sub_unit] - 1\n",
" dict3[unit].setdefault('体测人数',0)\n",
" dict3[unit]['体测人数'] = dict3[unit]['体测人数'] + 1\n",
"for k, v in dict3.items():\n",
" list2 = [k,v['人数'],v['体测人数']]\n",
" list1.append(list2)\n",
"\n",
"filename = 'data/天津石化部门测试情况(20241119).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": "85a03b00-9624-4ae9-aa6d-386798d457df",