This commit is contained in:
512song committed 2025-06-17 19:29:02 +08:00
1 parent b424b0f3b6
commit e9900a895e
3 files changed
+137 -312

No files matched your search

+93 -36
View File
@@ -10,15 +10,15 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 61,
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T10:07:44.495425Z",
"iopub.status.busy": "2025-06-13T10:07:44.493555Z",
"iopub.status.idle": "2025-06-13T10:07:44.777744Z",
"shell.execute_reply": "2025-06-13T10:07:44.777194Z",
"shell.execute_reply.started": "2025-06-13T10:07:44.495298Z"
"iopub.execute_input": "2025-06-17T10:58:46.889726Z",
"iopub.status.busy": "2025-06-17T10:58:46.888982Z",
"iopub.status.idle": "2025-06-17T10:58:47.160381Z",
"shell.execute_reply": "2025-06-17T10:58:47.159839Z",
"shell.execute_reply.started": "2025-06-17T10:58:46.889660Z"
},
"tags": []
},
@@ -27,7 +27,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
"1697 ok\n"
]
}
],
@@ -54,7 +54,7 @@
"filename = 'data/宁夏能化人员.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(person, fl, ensure_ascii=False)\n",
"print('ok')"
"print(len(person),'ok')"
]
},
{
@@ -105,15 +105,15 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 62,
"id": "970e171e-1360-448f-a28c-520ccb8f314a",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T10:07:57.397108Z",
"iopub.status.busy": "2025-06-13T10:07:57.396380Z",
"iopub.status.idle": "2025-06-13T10:07:57.473353Z",
"shell.execute_reply": "2025-06-13T10:07:57.472766Z",
"shell.execute_reply.started": "2025-06-13T10:07:57.397044Z"
"iopub.execute_input": "2025-06-17T10:58:52.418420Z",
"iopub.status.busy": "2025-06-17T10:58:52.417753Z",
"iopub.status.idle": "2025-06-17T10:58:52.531589Z",
"shell.execute_reply": "2025-06-17T10:58:52.531031Z",
"shell.execute_reply.started": "2025-06-17T10:58:52.418365Z"
},
"tags": []
},
@@ -122,7 +122,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1131\n"
"1690\n"
]
}
],
@@ -136,7 +136,7 @@
"filename = 'data/宁夏能化人员.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/marks_20250613.csv'\n",
"filename = 'data/marks_20250617.csv'\n",
"re_ta = My.get_result(filename,dict1)\n",
"\n",
"\n",
@@ -156,15 +156,15 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 63,
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T10:08:03.790216Z",
"iopub.status.busy": "2025-06-13T10:08:03.789961Z",
"iopub.status.idle": "2025-06-13T10:08:03.907343Z",
"shell.execute_reply": "2025-06-13T10:08:03.906882Z",
"shell.execute_reply.started": "2025-06-13T10:08:03.790193Z"
"iopub.execute_input": "2025-06-17T10:59:00.022684Z",
"iopub.status.busy": "2025-06-17T10:59:00.022098Z",
"iopub.status.idle": "2025-06-17T10:59:00.115280Z",
"shell.execute_reply": "2025-06-17T10:59:00.114797Z",
"shell.execute_reply.started": "2025-06-17T10:59:00.022633Z"
}
},
"outputs": [
@@ -288,15 +288,15 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 64,
"id": "c4b71b0f-0f0c-4962-a540-611cbab51bfa",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T10:22:08.044562Z",
"iopub.status.busy": "2025-06-13T10:22:08.043982Z",
"iopub.status.idle": "2025-06-13T10:22:08.121488Z",
"shell.execute_reply": "2025-06-13T10:22:08.120903Z",
"shell.execute_reply.started": "2025-06-13T10:22:08.044505Z"
"iopub.execute_input": "2025-06-17T10:59:19.218357Z",
"iopub.status.busy": "2025-06-17T10:59:19.217982Z",
"iopub.status.idle": "2025-06-17T10:59:19.259352Z",
"shell.execute_reply": "2025-06-17T10:59:19.258768Z",
"shell.execute_reply.started": "2025-06-17T10:59:19.218320Z"
}
},
"outputs": [],
@@ -326,7 +326,7 @@
"\n",
"\n",
"\n",
"filename = 'data/宁夏能化未体测人员(截至20250613).xlsx'\n",
"filename = 'data/宁夏能化未体测人员.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
@@ -346,15 +346,15 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 66,
"id": "def3f47a-24ef-4815-b63b-2a16b79b4c15",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T10:08:30.376056Z",
"iopub.status.busy": "2025-06-13T10:08:30.375387Z",
"iopub.status.idle": "2025-06-13T10:08:30.403659Z",
"shell.execute_reply": "2025-06-13T10:08:30.403187Z",
"shell.execute_reply.started": "2025-06-13T10:08:30.376001Z"
"iopub.execute_input": "2025-06-17T11:02:38.842412Z",
"iopub.status.busy": "2025-06-17T11:02:38.841860Z",
"iopub.status.idle": "2025-06-17T11:02:38.879864Z",
"shell.execute_reply": "2025-06-17T11:02:38.879320Z",
"shell.execute_reply.started": "2025-06-17T11:02:38.842360Z"
},
"tags": []
},
@@ -392,7 +392,64 @@
" list2 = [k,k1,v1['人数']]\n",
" list1.append(list2)\n",
"\n",
"filename = 'data/宁夏能化部门测试情况表(截至20260613).xlsx'\n",
"filename = 'data/宁夏能化部门测试情况表.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": "code",
"execution_count": 65,
"id": "61dde8c3-844a-4016-8952-cb726ab5f61d",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-17T11:01:30.219475Z",
"iopub.status.busy": "2025-06-17T11:01:30.218747Z",
"iopub.status.idle": "2025-06-17T11:01:30.259871Z",
"shell.execute_reply": "2025-06-17T11:01:30.259320Z",
"shell.execute_reply.started": "2025-06-17T11:01:30.219409Z"
}
},
"outputs": [],
"source": [
"import json\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",
"dict3 = {}\n",
"\n",
"\n",
"title =['单位','体测人数']\n",
"list1 = []\n",
"for k,v in dict2.items():\n",
" unit = v['unit']\n",
" if unit=='管理部门':\n",
" sub_unit = dict2[k]['sub_unit']\n",
" else:\n",
" sub_unit = unit\n",
" dict3.setdefault(unit,{}) \n",
" dict3[unit].setdefault(sub_unit,{})\n",
" dict3[unit][sub_unit].setdefault('人数',0)\n",
" dict3[unit][sub_unit]['人数'] = dict3[unit][sub_unit]['人数'] + 1\n",
"\n",
"for k, v in dict3.items():\n",
" list2 = []\n",
" for k1,v1 in v.items():\n",
" list2 = [k,k1,v1['人数']]\n",
" list1.append(list2)\n",
"\n",
"filename = 'data/宁夏能化部门人员情况表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",