This commit is contained in:
512song committed 2025-06-13 18:32:13 +08:00
1 parent db1359b2d0
commit b424b0f3b6
4 files changed
+496 -197

No files matched your search

+18 -18
View File
@@ -1297,15 +1297,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 5,
"id": "3e6da1e5-4b4e-448a-9663-815372da636b", "id": "3e6da1e5-4b4e-448a-9663-815372da636b",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2025-06-08T01:20:13.742945Z", "iopub.execute_input": "2025-06-13T03:27:04.981862Z",
"iopub.status.busy": "2025-06-08T01:20:13.742373Z", "iopub.status.busy": "2025-06-13T03:27:04.981235Z",
"iopub.status.idle": "2025-06-08T01:20:13.794862Z", "iopub.status.idle": "2025-06-13T03:27:05.072701Z",
"shell.execute_reply": "2025-06-08T01:20:13.794371Z", "shell.execute_reply": "2025-06-13T03:27:05.072214Z",
"shell.execute_reply.started": "2025-06-08T01:20:13.742894Z" "shell.execute_reply.started": "2025-06-13T03:27:04.981836Z"
} }
}, },
"outputs": [ "outputs": [
@@ -1407,15 +1407,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 6,
"id": "d07d132b-dd74-458d-af0c-6a6ae005ad3a", "id": "d07d132b-dd74-458d-af0c-6a6ae005ad3a",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2025-06-09T08:13:09.484342Z", "iopub.execute_input": "2025-06-13T03:27:18.479485Z",
"iopub.status.busy": "2025-06-09T08:13:09.483682Z", "iopub.status.busy": "2025-06-13T03:27:18.478877Z",
"iopub.status.idle": "2025-06-09T08:13:09.516356Z", "iopub.status.idle": "2025-06-13T03:27:18.509731Z",
"shell.execute_reply": "2025-06-09T08:13:09.515813Z", "shell.execute_reply": "2025-06-13T03:27:18.509101Z",
"shell.execute_reply.started": "2025-06-09T08:13:09.484283Z" "shell.execute_reply.started": "2025-06-13T03:27:18.479432Z"
} }
}, },
"outputs": [ "outputs": [
@@ -1457,15 +1457,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 7,
"id": "971d592d-9ff5-4758-af68-2f60a986c2a2", "id": "971d592d-9ff5-4758-af68-2f60a986c2a2",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2025-06-09T08:13:24.385566Z", "iopub.execute_input": "2025-06-13T03:27:29.624787Z",
"iopub.status.busy": "2025-06-09T08:13:24.384878Z", "iopub.status.busy": "2025-06-13T03:27:29.623200Z",
"iopub.status.idle": "2025-06-09T08:13:24.414310Z", "iopub.status.idle": "2025-06-13T03:27:29.651956Z",
"shell.execute_reply": "2025-06-09T08:13:24.413783Z", "shell.execute_reply": "2025-06-13T03:27:29.651402Z",
"shell.execute_reply.started": "2025-06-09T08:13:24.385501Z" "shell.execute_reply.started": "2025-06-13T03:27:29.624721Z"
} }
}, },
"outputs": [ "outputs": [
+8 -121
View File
@@ -10,16 +10,9 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 23, "execution_count": null,
"id": "360f0a97-d73d-43f3-9f7a-0f9582103c82", "id": "360f0a97-d73d-43f3-9f7a-0f9582103c82",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-03-20T09:18:01.505731Z",
"iopub.status.busy": "2025-03-20T09:18:01.504944Z",
"iopub.status.idle": "2025-03-20T09:18:01.519437Z",
"shell.execute_reply": "2025-03-20T09:18:01.518406Z",
"shell.execute_reply.started": "2025-03-20T09:18:01.505657Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -53,26 +46,10 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 24, "execution_count": null,
"id": "6ce2cbc7-435a-461c-bdb8-abd9a6962fbc", "id": "6ce2cbc7-435a-461c-bdb8-abd9a6962fbc",
"metadata": { "metadata": {},
"execution": { "outputs": [],
"iopub.execute_input": "2025-03-20T09:19:55.399000Z",
"iopub.status.busy": "2025-03-20T09:19:55.398328Z",
"iopub.status.idle": "2025-03-20T09:19:55.423109Z",
"shell.execute_reply": "2025-03-20T09:19:55.422235Z",
"shell.execute_reply.started": "2025-03-20T09:19:55.398942Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"31 ok\n"
]
}
],
"source": [ "source": [
"import openpyxl\n", "import openpyxl\n",
"import os,sys,shutil\n", "import os,sys,shutil\n",
@@ -137,57 +114,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": null,
"id": "5f665c0f-8d30-4759-b7f8-fb7e13b98efa", "id": "5f665c0f-8d30-4759-b7f8-fb7e13b98efa",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-03-20T09:20:14.292047Z",
"iopub.status.busy": "2025-03-20T09:20:14.291517Z",
"iopub.status.idle": "2025-03-20T09:20:14.320715Z",
"shell.execute_reply": "2025-03-20T09:20:14.319854Z",
"shell.execute_reply.started": "2025-03-20T09:20:14.291999Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 18654628632 0028-张红丽.pdf 206138\n",
"2 13589980155 0032-马建辉.pdf 208451\n",
"3 13963394816 0029-张凤魁.pdf 205879\n",
"4 13905462350 0034-张晓云.pdf 203015\n",
"5 13562280825 0016-李爱云.pdf 200689\n",
"6 15318339058 0007-韩金秀.pdf 203970\n",
"7 13589956960 0026-严新杰.pdf 200467\n",
"8 13906478916 0003-曹春梅.pdf 205019\n",
"9 13706476046 0023-王维卿.pdf 208975\n",
"10 13561090015 0022-王金文.pdf 204916\n",
"11 13013569039 0006-耿红霞.pdf 209158\n",
"12 13954622371 0019-王国臣.pdf 204637\n",
"13 18905466915 0017-梁秀荣.pdf 208243\n",
"14 13012902582 0030-张明霞.pdf 203281\n",
"15 13954626181 0013-李佐东.pdf 202568\n",
"16 13287350839 0020-王秀娟.pdf 200195\n",
"17 13954654611 0035-单丽荣.pdf 205740\n",
"18 13792079628 0031-马羚.pdf 201534\n",
"19 13563378335 0027-赵芳霞.pdf 205462\n",
"20 15105461296 0001-丛霞.pdf 203872\n",
"21 18653699898 0025-杨江萍.pdf 204830\n",
"22 13082601667 0021-王静.pdf 207801\n",
"23 13954606669 0033-朱莲女.pdf 207605\n",
"24 13864757610 0036-赵萍.pdf 208520\n",
"25 13287336162 0012-鲁兴湘.pdf 200654\n",
"26 13325052019 0010-刘敏.pdf 200635\n",
"27 13589965775 0011-李梅.pdf 206794\n",
"28 13864739068 0018-孙杰.pdf 203096\n",
"29 15105461298 0002-陈秀华.pdf 205248\n",
"30 15550503986 0005-丁元花.pdf 201624\n",
"31 15005463621 0037-高学晖.pdf 206374\n"
]
}
],
"source": [ "source": [
"from tencentcloud.common import credential\n", "from tencentcloud.common import credential\n",
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n", "from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
@@ -263,57 +195,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 26, "execution_count": null,
"id": "4b2b5d76-665f-4dfe-bbd3-5c80abd8c3e3", "id": "4b2b5d76-665f-4dfe-bbd3-5c80abd8c3e3",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-03-20T09:20:55.440081Z",
"iopub.status.busy": "2025-03-20T09:20:55.439083Z",
"iopub.status.idle": "2025-03-20T09:23:36.769544Z",
"shell.execute_reply": "2025-03-20T09:23:36.768167Z",
"shell.execute_reply.started": "2025-03-20T09:20:55.440022Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"18654628632 206138 send success\n",
"13589980155 208451 send success\n",
"13963394816 205879 send success\n",
"13905462350 203015 send success\n",
"13562280825 200689 send success\n",
"15318339058 203970 send success\n",
"13589956960 200467 send success\n",
"13906478916 205019 send success\n",
"13706476046 208975 send success\n",
"13561090015 204916 send success\n",
"13013569039 209158 send success\n",
"13954622371 204637 send success\n",
"18905466915 208243 send success\n",
"13012902582 203281 send success\n",
"13954626181 202568 send success\n",
"13287350839 200195 send success\n",
"13954654611 205740 send success\n",
"13792079628 201534 send success\n",
"13563378335 205462 send success\n",
"15105461296 203872 send success\n",
"18653699898 204830 send success\n",
"13082601667 207801 send success\n",
"13954606669 207605 send success\n",
"13864757610 208520 send success\n",
"13287336162 200654 send success\n",
"13325052019 200635 send success\n",
"13589965775 206794 send success\n",
"13864739068 203096 send success\n",
"15105461298 205248 send success\n",
"15550503986 201624 send success\n",
"15005463621 206374 send success\n"
]
}
],
"source": [ "source": [
"from tencentcloud.common import credential\n", "from tencentcloud.common import credential\n",
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n", "from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
+255 -24
View File
@@ -1567,16 +1567,32 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 25,
"id": "46aa847d-e1fe-45bd-85b6-e2d792ec8842", "id": "46aa847d-e1fe-45bd-85b6-e2d792ec8842",
"metadata": {}, "metadata": {
"outputs": [], "execution": {
"iopub.execute_input": "2025-06-13T03:27:43.345675Z",
"iopub.status.busy": "2025-06-13T03:27:43.344810Z",
"iopub.status.idle": "2025-06-13T03:27:43.375331Z",
"shell.execute_reply": "2025-06-13T03:27:43.374819Z",
"shell.execute_reply.started": "2025-06-13T03:27:43.345586Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"245\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import openpyxl\n", "import openpyxl\n",
"\n", "\n",
"\n", "\n",
"filename = 'data/result_长炼医院人员2024(汇总).json'\n", "filename = 'data/result_东营石油工程设计院2025.json'\n",
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n", " dict1 = json.load(fl)\n",
"\n", "\n",
@@ -1629,7 +1645,7 @@
" mydata['score'] = round(score/len(mydata['fits']),2)\n", " mydata['score'] = round(score/len(mydata['fits']),2)\n",
" if len(mydata['fits']) >2:\n", " if len(mydata['fits']) >2:\n",
" dict2[str(k)] = mydata\n", " dict2[str(k)] = mydata\n",
"filename = f'data/data_长炼医院人员2024(汇总).json'\n", "filename = f'data/data_东营石油工程设计院2025.json'\n",
"with open(filename,'w') as fl:\n", "with open(filename,'w') as fl:\n",
" json.dump(dict2,fl , ensure_ascii=False) \n", " json.dump(dict2,fl , ensure_ascii=False) \n",
"print(len(dict2)) " "print(len(dict2)) "
@@ -1645,17 +1661,34 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 26,
"id": "63edd636-f034-4aa6-8575-63d5cdb84adb", "id": "63edd636-f034-4aa6-8575-63d5cdb84adb",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:27:46.364073Z",
"iopub.status.busy": "2025-06-13T03:27:46.363417Z",
"iopub.status.idle": "2025-06-13T03:27:46.376251Z",
"shell.execute_reply": "2025-06-13T03:27:46.375056Z",
"shell.execute_reply.started": "2025-06-13T03:27:46.364014Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"平均成绩:2.8665分,男性:150人\n",
"平均成绩:3.3401分,女性:95人\n",
"平均成绩:3.0501分,总体:245人\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
"filename = 'data/data_长炼医院人员2024(汇总).json'\n", "filename = 'data/data_东营石油工程设计院2025.json'\n",
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
"i = 1\n", "i = 1\n",
@@ -1689,12 +1722,32 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 17,
"id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1", "id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:10:24.343017Z",
"iopub.status.busy": "2025-06-13T03:10:24.342314Z",
"iopub.status.idle": "2025-06-13T03:10:24.366828Z",
"shell.execute_reply": "2025-06-13T03:10:24.366315Z",
"shell.execute_reply.started": "2025-06-13T03:10:24.342957Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0~255分人数:45人,男性:38人,女性:7人\n",
"256~332分人数:118人,男性:82人,女性:36人\n",
"333~367分人数:52人,男性:24人,女性:28人\n",
"368~500分人数:30人,男性:6人,女性:24人\n",
"245\n",
"ok\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -1740,12 +1793,34 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 18,
"id": "2d661ca6-6129-4da1-ac25-51d0156babb2", "id": "2d661ca6-6129-4da1-ac25-51d0156babb2",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:11:04.066827Z",
"iopub.status.busy": "2025-06-13T03:11:04.066130Z",
"iopub.status.idle": "2025-06-13T03:11:04.078917Z",
"shell.execute_reply": "2025-06-13T03:11:04.077948Z",
"shell.execute_reply.started": "2025-06-13T03:11:04.066766Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20-24 {'合格': 1, '不合格': 0, '优秀': 0, '良好': 1}\n",
"25-29 {'不合格': 3, '合格': 9, '良好': 5}\n",
"30-34 {'合格': 7, '不合格': 3, '良好': 3, '优秀': 3}\n",
"35-39 {'合格': 8, '不合格': 0, '良好': 5, '优秀': 7}\n",
"40-44 {'优秀': 4, '合格': 8, '良好': 2, '不合格': 1}\n",
"45-49 {'合格': 3, '良好': 5, '优秀': 7, '不合格': 0}\n",
"50-54 {'合格': 0, '良好': 7, '优秀': 1, '不合格': 0}\n",
"55-80 {'合格': 0, '优秀': 2, '不合格': 0}\n"
]
}
],
"source": [ "source": [
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
"\n", "\n",
@@ -1785,12 +1860,34 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 19,
"id": "fc97df37-34ff-4a02-9d26-b5d81b706e46", "id": "fc97df37-34ff-4a02-9d26-b5d81b706e46",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:12:54.692628Z",
"iopub.status.busy": "2025-06-13T03:12:54.692075Z",
"iopub.status.idle": "2025-06-13T03:12:54.709238Z",
"shell.execute_reply": "2025-06-13T03:12:54.708365Z",
"shell.execute_reply.started": "2025-06-13T03:12:54.692563Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20-24 {'合格': 5, '不合格': 2, '优秀': 1, '良好': 0}\n",
"25-29 {'不合格': 18, '合格': 18, '良好': 4}\n",
"30-34 {'合格': 7, '不合格': 5, '良好': 3, '优秀': 0}\n",
"35-39 {'合格': 18, '不合格': 5, '良好': 4, '优秀': 2}\n",
"40-44 {'优秀': 0, '合格': 12, '良好': 5, '不合格': 3}\n",
"45-49 {'合格': 5, '良好': 3, '优秀': 2, '不合格': 2}\n",
"50-54 {'合格': 10, '良好': 5, '优秀': 1, '不合格': 2}\n",
"55-80 {'合格': 7, '优秀': 0, '不合格': 1}\n"
]
}
],
"source": [ "source": [
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
"\n", "\n",
@@ -1830,12 +1927,34 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 20,
"id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5", "id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:13:59.203744Z",
"iopub.status.busy": "2025-06-13T03:13:59.202995Z",
"iopub.status.idle": "2025-06-13T03:13:59.216251Z",
"shell.execute_reply": "2025-06-13T03:13:59.215658Z",
"shell.execute_reply.started": "2025-06-13T03:13:59.203674Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"16~24岁平均成绩:2.83分,人数:10人,男性:8人\n",
"25~29岁平均成绩:2.74分,人数:57人,男性:40人\n",
"30~34岁平均成绩:2.99分,人数:31人,男性:15人\n",
"35~39岁平均成绩:3.17分,人数:49人,男性:29人\n",
"40~44岁平均成绩:3.16分,人数:35人,男性:20人\n",
"45~49岁平均成绩:3.33分,人数:27人,男性:12人\n",
"50~54岁平均成绩:3.19分,人数:26人,男性:18人\n",
"55~69岁平均成绩:3.1分,人数:10人,男性:8人\n"
]
}
],
"source": [ "source": [
"nld = [[16,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,69]]\n", "nld = [[16,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,69]]\n",
"\n", "\n",
@@ -1870,12 +1989,34 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 21,
"id": "347703a1-501b-4800-bd29-16e94f4a6793", "id": "347703a1-501b-4800-bd29-16e94f4a6793",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:15:34.340578Z",
"iopub.status.busy": "2025-06-13T03:15:34.340095Z",
"iopub.status.idle": "2025-06-13T03:15:34.348781Z",
"shell.execute_reply": "2025-06-13T03:15:34.348295Z",
"shell.execute_reply.started": "2025-06-13T03:15:34.340549Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.76分,人数:8人\n",
"25~29岁平均成绩:2.65分,人数:40人\n",
"30~34岁平均成绩:2.79分,人数:15人\n",
"35~39岁平均成绩:2.94分,人数:29人\n",
"40~44岁平均成绩:3.0分,人数:20人\n",
"45~49岁平均成绩:3.06分,人数:12人\n",
"50~54岁平均成绩:3.06分,人数:18人\n",
"55~80岁平均成绩:2.86分,人数:8人\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -1910,12 +2051,34 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 22,
"id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d", "id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:16:41.823699Z",
"iopub.status.busy": "2025-06-13T03:16:41.822974Z",
"iopub.status.idle": "2025-06-13T03:16:41.834407Z",
"shell.execute_reply": "2025-06-13T03:16:41.833439Z",
"shell.execute_reply.started": "2025-06-13T03:16:41.823631Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:3.1分,人数:2人\n",
"25~29岁平均成绩:2.96分,人数:17人\n",
"30~34岁平均成绩:3.18分,人数:16人\n",
"35~39岁平均成绩:3.51分,人数:20人\n",
"40~44岁平均成绩:3.37分,人数:15人\n",
"45~49岁平均成绩:3.54分,人数:15人\n",
"50~54岁平均成绩:3.5分,人数:8人\n",
"55~80岁平均成绩:4.05分,人数:2人\n"
]
}
],
"source": [ "source": [
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
"\n", "\n",
@@ -1948,12 +2111,36 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 23,
"id": "ad69c45d-3f62-42df-894d-47424e759029", "id": "ad69c45d-3f62-42df-894d-47424e759029",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:17:34.005747Z",
"iopub.status.busy": "2025-06-13T03:17:34.004277Z",
"iopub.status.idle": "2025-06-13T03:17:34.022395Z",
"shell.execute_reply": "2025-06-13T03:17:34.021433Z",
"shell.execute_reply.started": "2025-06-13T03:17:34.005659Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BMI 3.52 245\n",
"肺活量 3.83 245\n",
"握力 2.15 245\n",
"坐位体前屈 2.64 240\n",
"纵跳 2.95 243\n",
"俯卧撑 3.56 143\n",
"一分钟仰卧起坐 4.17 88\n",
"单脚站立 2.77 245\n",
"选择反应时 3.46 245\n",
"台阶指数 2.37 231\n"
]
}
],
"source": [ "source": [
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
@@ -1978,12 +2165,56 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 27,
"id": "dcf152e7-bbcc-47d1-9c5f-83854db35412", "id": "dcf152e7-bbcc-47d1-9c5f-83854db35412",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:27:56.882319Z",
"iopub.status.busy": "2025-06-13T03:27:56.881715Z",
"iopub.status.idle": "2025-06-13T03:27:56.891628Z",
"shell.execute_reply": "2025-06-13T03:27:56.890677Z",
"shell.execute_reply.started": "2025-06-13T03:27:56.882261Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"管道工程设计所 2.96 30\n",
"勘察与地下工程事业部 2.87 21\n",
"电力设计所 3.03 13\n",
"注水及水处理工艺设计所 2.98 11\n",
"油气工艺设计所 2.81 20\n",
"机械设备设计所 3.08 8\n",
"集成设计中心 2.78 12\n",
"经营管理部 2.44 1\n",
"技术发展中心 2.98 6\n",
"党群工作部 3.67 1\n",
"财务资产部 3.64 5\n",
"智能化研究中心 3.29 21\n",
"建筑设计所 3.33 14\n",
"档案管理中心 3.37 8\n",
"综合服务中心 3.04 8\n",
"绿色低碳技术研究中心 3.03 8\n",
"控制部 3.12 6\n",
"党委组织部(人力资源部) 3.11 1\n",
"工程监理公司 3.06 6\n",
"施工管理部 3.04 5\n",
"物资装备管理中心 3.47 4\n",
"海洋工程设计所 2.78 9\n",
"国际工程管理部 2.89 1\n",
"自控通信设计所 3.05 12\n",
"法律合规部 3.59 3\n",
"工程造价中心 3.04 7\n",
"运行管理部 3.0 1\n",
"纪检监督部 3.33 1\n",
"项目执行部 3.33 1\n",
"HSE管理部 3.11 1\n"
]
}
],
"source": [ "source": [
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
+215 -34
View File
@@ -10,12 +10,27 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 33,
"id": "bbba6efc-73cd-4db6-bae7-014724fee731", "id": "bbba6efc-73cd-4db6-bae7-014724fee731",
"metadata": { "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"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [ "source": [
"import openpyxl\n", "import openpyxl\n",
"import json\n", "import json\n",
@@ -90,12 +105,27 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 34,
"id": "970e171e-1360-448f-a28c-520ccb8f314a", "id": "970e171e-1360-448f-a28c-520ccb8f314a",
"metadata": { "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"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1131\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import datetime\n", "import datetime\n",
@@ -106,7 +136,7 @@
"filename = 'data/宁夏能化人员.json'\n", "filename = 'data/宁夏能化人员.json'\n",
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
"filename = 'data/marks_20250611.csv'\n", "filename = 'data/marks_20250613.csv'\n",
"re_ta = My.get_result(filename,dict1)\n", "re_ta = My.get_result(filename,dict1)\n",
"\n", "\n",
"\n", "\n",
@@ -116,6 +146,72 @@
"print(len(re_ta))" "print(len(re_ta))"
] ]
}, },
{
"cell_type": "markdown",
"id": "6d381859-6d21-45d2-8313-55ebbabf8bd4",
"metadata": {},
"source": [
"## 生成测试得分"
]
},
{
"cell_type": "code",
"execution_count": 35,
"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"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok!\n"
]
}
],
"source": [
"import json\n",
"import time\n",
"import my_module as My\n",
"\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",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"for k, v in dict2.items():\n",
" #print(k)\n",
" if v['sex'] == '男':\n",
" sex = 'M'\n",
" else:\n",
" sex = 'F' \n",
" if 'bmi' in v.keys():\n",
" #bmi_data = v['height']['成绩'].split()[0]+','+ v['weight']['成绩'].split()[0]\n",
" bmi_data = v['bmi']['成绩']\n",
" data1 = {'code':k,'sex':sex,'age':v['age'],'item':'HeightWeight','result':bmi_data}\n",
" dict2[k]['bmi'] = {}\n",
" dict2[k]['bmi']['成绩'] = bmi_data\n",
" dict2[k]['bmi']['score'] = My.cal_bmi(data1)\n",
" for item_en in list_item:\n",
" if item_en in v.keys(): \n",
" data1 = {'code':k,'sex':sex,'age':v['age'],'item':item_en,'result':float(v[item_en]['成绩'].split()[0])}\n",
" #print(k,v['name'])\n",
" dict2[k][item_en]['score'] = My.cal_score(data1)\n",
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
"\n",
"filename = f'data/result_宁夏能化人员.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict2,fl , ensure_ascii=False) \n",
"print('ok!') "
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "d034a61d-1fbd-417b-99bd-277e43ebb678", "id": "d034a61d-1fbd-417b-99bd-277e43ebb678",
@@ -192,15 +288,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 23, "execution_count": 37,
"id": "c4b71b0f-0f0c-4962-a540-611cbab51bfa", "id": "c4b71b0f-0f0c-4962-a540-611cbab51bfa",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2025-06-11T10:33:23.785169Z", "iopub.execute_input": "2025-06-13T10:22:08.044562Z",
"iopub.status.busy": "2025-06-11T10:33:23.784411Z", "iopub.status.busy": "2025-06-13T10:22:08.043982Z",
"iopub.status.idle": "2025-06-11T10:33:23.824528Z", "iopub.status.idle": "2025-06-13T10:22:08.121488Z",
"shell.execute_reply": "2025-06-11T10:33:23.823918Z", "shell.execute_reply": "2025-06-13T10:22:08.120903Z",
"shell.execute_reply.started": "2025-06-11T10:33:23.785101Z" "shell.execute_reply.started": "2025-06-13T10:22:08.044505Z"
} }
}, },
"outputs": [], "outputs": [],
@@ -215,29 +311,22 @@
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n", " dict2 = json.load(fl)\n",
"\n", "\n",
"dict3 = {}\n", "list1 = []\n",
"for k, v in dict2.items():\n", "for k, v in dict2.items():\n",
" if k not in dict1.keys():\n",
" list2 = []\n",
" unit = v['unit']\n", " unit = v['unit']\n",
" if unit=='管理部门':\n", " if unit=='管理部门':\n",
" sub_unit = v['sub_unit']\n", " sub_unit = v['sub_unit']\n",
" else:\n", " else:\n",
" sub_unit = unit\n", " sub_unit = unit\n",
" dict3.setdefault(unit,{}) \n", " list2 = [k,v['name'],v['sex'],sub_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",
" #dict3[unit]['人数'] = dict3[unit]['人数'] + 1\n",
"\n",
"title =['单位','体测人数']\n",
"list1 = []\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", " list1.append(list2)\n",
" \n", " \n",
"filename = 'data/宁夏能化人员情况.xlsx'\n", "\n",
"\n",
"\n",
"filename = 'data/宁夏能化未体测人员(截至20250613).xlsx'\n",
"wb = openpyxl.Workbook()\n", "wb = openpyxl.Workbook()\n",
"sheet = wb.active\n", "sheet = wb.active\n",
"sheet.append(title)\n", "sheet.append(title)\n",
@@ -257,15 +346,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": 36,
"id": "def3f47a-24ef-4815-b63b-2a16b79b4c15", "id": "def3f47a-24ef-4815-b63b-2a16b79b4c15",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2025-06-11T10:49:09.048584Z", "iopub.execute_input": "2025-06-13T10:08:30.376056Z",
"iopub.status.busy": "2025-06-11T10:49:09.047316Z", "iopub.status.busy": "2025-06-13T10:08:30.375387Z",
"iopub.status.idle": "2025-06-11T10:49:09.067937Z", "iopub.status.idle": "2025-06-13T10:08:30.403659Z",
"shell.execute_reply": "2025-06-11T10:49:09.067219Z", "shell.execute_reply": "2025-06-13T10:08:30.403187Z",
"shell.execute_reply.started": "2025-06-11T10:49:09.048505Z" "shell.execute_reply.started": "2025-06-13T10:08:30.376001Z"
}, },
"tags": [] "tags": []
}, },
@@ -303,7 +392,7 @@
" list2 = [k,k1,v1['人数']]\n", " list2 = [k,k1,v1['人数']]\n",
" list1.append(list2)\n", " list1.append(list2)\n",
"\n", "\n",
"filename = 'data/宁夏能化部门测试情况表(截至20260611).xlsx'\n", "filename = 'data/宁夏能化部门测试情况表(截至20260613).xlsx'\n",
"wb = openpyxl.Workbook()\n", "wb = openpyxl.Workbook()\n",
"sheet = wb.active\n", "sheet = wb.active\n",
"sheet.append(title)\n", "sheet.append(title)\n",
@@ -313,10 +402,102 @@
"wb.save(filename)" "wb.save(filename)"
] ]
}, },
{
"cell_type": "markdown",
"id": "8d5f4103-0d1e-4711-b324-ece360f8dcd3",
"metadata": {},
"source": [
"## 生成报告"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
"metadata": {
"execution": {
"iopub.execute_input": "2025-06-13T03:03:04.228661Z",
"iopub.status.busy": "2025-06-13T03:03:04.228138Z",
"iopub.status.idle": "2025-06-13T03:08:51.563935Z",
"shell.execute_reply": "2025-06-13T03:08:51.562949Z",
"shell.execute_reply.started": "2025-06-13T03:03:04.228598Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"690\n"
]
}
],
"source": [
"import requests\n",
"import json\n",
"import openpyxl\n",
"\n",
"\n",
"headers = {\n",
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
" }\n",
"filename = 'data/result_宁夏能化人员.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"file_path ='./宁夏能化人员/'\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
"i=0\n",
"list2 = []\n",
"for k, v in dict1.items():\n",
" list1 = []\n",
" mydata = {}\n",
" \n",
" id = str(k).rjust(4,\"0\")\n",
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
" mydata['title'] = '中国石化长城能源化工(宁夏)有限公司'\n",
" mydata['subtitle'] = v['unit']\n",
" mydata['id'] = id\n",
" mydata['name'] = v['name']\n",
" if v['sex'] == '男':\n",
" mydata['gender'] = 'male'\n",
" else:\n",
" mydata['gender'] = 'female'\n",
" \n",
" mydata['month'] = v['month']\n",
" mydata['fits'] = {}\n",
" survey_list = ['tcm','psy57','spine']\n",
" for item in survey_list:\n",
" if item in v.keys():\n",
" mydata.setdefault('surveys',{})\n",
" mydata['surveys'][item] = v[item]\n",
" \n",
" \n",
" #mydata['fits'] = {}\n",
" for item in list_item:\n",
" if item in v.keys():\n",
" mydata.setdefault('fits',{})\n",
" if item in ['lung','pushup','step','situp']:\n",
" mark = v[item]['成绩'].split()[0].split('.')[0]\n",
" else:\n",
" mark = v[item]['成绩'].split()[0]\n",
" mydata['fits'][item] = {'mark':mark,'score':v[item]['score']}\n",
" #if len(mydata['fits']) >2 or len(mydata['surveys']) >0:\n",
" if len(mydata['fits']) >2 : \n",
" list1.append(mydata)\n",
" list2.append([k,v['name']])\n",
" i+=1\n",
" x = requests.post('http://localhost:3003', data = json.dumps(list1), headers=headers)\n",
" #print(id,v['name'],x.text)\n",
" #print(mydata)\n",
" #x.close()\n",
"print(i)"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "67e63f07-3f20-4e0e-9c07-7bf6024eeb4b", "id": "87556725-f68a-484b-827c-f6735155e940",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [] "source": []