20250703
This commit is contained in:
1 parent
b58fc4376a
commit
321337fdda
6 files changed
+1101
-479
No files matched your search
+16
-197
@@ -173,15 +173,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 18,
|
"execution_count": 1,
|
||||||
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
|
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-20T10:51:03.742479Z",
|
"iopub.execute_input": "2025-06-30T01:44:44.903147Z",
|
||||||
"iopub.status.busy": "2025-06-20T10:51:03.741782Z",
|
"iopub.status.busy": "2025-06-30T01:44:44.902892Z",
|
||||||
"iopub.status.idle": "2025-06-20T10:51:03.759950Z",
|
"iopub.status.idle": "2025-06-30T01:44:44.920727Z",
|
||||||
"shell.execute_reply": "2025-06-20T10:51:03.759128Z",
|
"shell.execute_reply": "2025-06-30T01:44:44.920259Z",
|
||||||
"shell.execute_reply.started": "2025-06-20T10:51:03.742415Z"
|
"shell.execute_reply.started": "2025-06-30T01:44:44.903119Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -301,187 +301,6 @@
|
|||||||
"wb.save(filename)"
|
"wb.save(filename)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "699c6a40-a6ae-4300-9646-708cb85aa5e8",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"## 统计各部门测试人员情况"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 64,
|
|
||||||
"id": "c4b71b0f-0f0c-4962-a540-611cbab51bfa",
|
|
||||||
"metadata": {
|
|
||||||
"execution": {
|
|
||||||
"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": [],
|
|
||||||
"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",
|
|
||||||
"list1 = []\n",
|
|
||||||
"for k, v in dict2.items():\n",
|
|
||||||
" if k not in dict1.keys():\n",
|
|
||||||
" list2 = []\n",
|
|
||||||
" unit = v['unit']\n",
|
|
||||||
" if unit=='管理部门':\n",
|
|
||||||
" sub_unit = v['sub_unit']\n",
|
|
||||||
" else:\n",
|
|
||||||
" sub_unit = unit\n",
|
|
||||||
" list2 = [k,v['name'],v['sex'],sub_unit]\n",
|
|
||||||
" list1.append(list2)\n",
|
|
||||||
" \n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"\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": "markdown",
|
|
||||||
"id": "3796748f-2079-46b6-a3a1-b22441880843",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"## 统计各部门已测试情况"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 66,
|
|
||||||
"id": "def3f47a-24ef-4815-b63b-2a16b79b4c15",
|
|
||||||
"metadata": {
|
|
||||||
"execution": {
|
|
||||||
"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": []
|
|
||||||
},
|
|
||||||
"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 dict1.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",
|
|
||||||
"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",
|
|
||||||
"for row in list1:\n",
|
|
||||||
" sheet.append(row)\n",
|
|
||||||
" \n",
|
|
||||||
"wb.save(filename)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "8d5f4103-0d1e-4711-b324-ece360f8dcd3",
|
"id": "8d5f4103-0d1e-4711-b324-ece360f8dcd3",
|
||||||
@@ -492,15 +311,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 8,
|
"execution_count": 2,
|
||||||
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
|
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-18T01:49:13.699255Z",
|
"iopub.execute_input": "2025-06-30T01:45:55.830006Z",
|
||||||
"iopub.status.busy": "2025-06-18T01:49:13.698689Z",
|
"iopub.status.busy": "2025-06-30T01:45:55.829354Z",
|
||||||
"iopub.status.idle": "2025-06-18T02:04:11.786609Z",
|
"iopub.status.idle": "2025-06-30T01:46:34.709813Z",
|
||||||
"shell.execute_reply": "2025-06-18T02:04:11.785557Z",
|
"shell.execute_reply": "2025-06-30T01:46:34.708788Z",
|
||||||
"shell.execute_reply.started": "2025-06-18T01:49:13.699200Z"
|
"shell.execute_reply.started": "2025-06-30T01:45:55.829948Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -508,7 +327,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"1690\n"
|
"70\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -521,11 +340,11 @@
|
|||||||
"headers = {\n",
|
"headers = {\n",
|
||||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||||
" }\n",
|
" }\n",
|
||||||
"filename = 'data/result_宁夏能化人员.json'\n",
|
"filename = 'data/result_东营胜利宾馆.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",
|
||||||
"list1 = []\n",
|
"list1 = []\n",
|
||||||
"file_path ='./宁夏能化人员/'\n",
|
"file_path ='./东营胜利宾馆/'\n",
|
||||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||||
"i=0\n",
|
"i=0\n",
|
||||||
"list2 = []\n",
|
"list2 = []\n",
|
||||||
@@ -535,7 +354,7 @@
|
|||||||
" \n",
|
" \n",
|
||||||
" id = str(k).rjust(4,\"0\")\n",
|
" id = str(k).rjust(4,\"0\")\n",
|
||||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||||
" mydata['title'] = '中国石化长城能源化工(宁夏)有限公司'\n",
|
" mydata['title'] = '东营胜利宾馆'\n",
|
||||||
" mydata['subtitle'] = v['unit']\n",
|
" mydata['subtitle'] = v['unit']\n",
|
||||||
" mydata['id'] = id\n",
|
" mydata['id'] = id\n",
|
||||||
" mydata['name'] = v['name']\n",
|
" mydata['name'] = v['name']\n",
|
||||||
|
|||||||
+299
-50
@@ -391,16 +391,32 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 37,
|
||||||
"id": "d6498431-2103-4d27-bba9-f1669b710361",
|
"id": "d6498431-2103-4d27-bba9-f1669b710361",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
"outputs": [],
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-02T07:57:16.226394Z",
|
||||||
|
"iopub.status.busy": "2025-07-02T07:57:16.225723Z",
|
||||||
|
"iopub.status.idle": "2025-07-02T07:57:16.244956Z",
|
||||||
|
"shell.execute_reply": "2025-07-02T07:57:16.244165Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-02T07:57:16.226327Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"('345321','1787376','pushup','2','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1787128','pushup','2','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1789517','pushup','2','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786135','pushup','3','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1789748','pushup','3','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3530344','pushup','4','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786084','pushup','5','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788859','pushup','5','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783509','pushup','5','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1782462','pushup','5','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788929','pushup','6','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1789072','pushup','6','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1782596','pushup','6','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1780972','pushup','7','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786095','pushup','8','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788116','pushup','8','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783917','pushup','8','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786562','pushup','9','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1787804','pushup','9','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1782395','pushup','10','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1782049','pushup','10','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783534','pushup','10','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783827','pushup','10','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783263','pushup','10','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3540299','pushup','11','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1789560','pushup','11','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786102','pushup','12','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788660','pushup','12','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1780017','pushup','12','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1789307','pushup','12','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788676','pushup','12','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788744','pushup','14','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786234','pushup','14','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3530368','pushup','14','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1789685','pushup','14','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1785410','pushup','15','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783124','pushup','15','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788788','pushup','15','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788120','pushup','15','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1795937','pushup','15','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786639','pushup','16','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3540355','pushup','18','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788685','pushup','19','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3470775','pushup','20','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786153','pushup','21','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3566780','pushup','22','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3438972','pushup','28','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3566790','pushup','29','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3566668','pushup','29','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786252','pushup','30','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1783259','pushup','31','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3219236','pushup','34','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788226','pushup','40','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788113','pushup','40','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3540363','pushup','47','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786183','pushup','52','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','3502448','pushup','62','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1786259','pushup','101','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1787741','situp','12','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1784476','situp','17','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1788718','situp','19','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1785742','situp','24','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1787496','bmi','155.0,65.0','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1780280','bmi','173.0,85.0','2025-07-02','2025-07-02 16:00:00.000 +0800'),('None','1Line truncated
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"wb = openpyxl.load_workbook('data/手工数据3.xlsx',data_only=True)\n",
|
"wb = openpyxl.load_workbook('data/手工数据4.xlsx',data_only=True)\n",
|
||||||
"sheet = wb.active\n",
|
"sheet = wb.active\n",
|
||||||
"s = ''\n",
|
"s = ''\n",
|
||||||
"list1 = []\n",
|
"list1 = []\n",
|
||||||
@@ -835,12 +851,12 @@
|
|||||||
"import glob\n",
|
"import glob\n",
|
||||||
"from pathlib import Path\n",
|
"from pathlib import Path\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fi_path = '/home/songyi/pdf-typescript-old2/东营石油设计院2025'\n",
|
"fi_path = '/home/songyi/pdf-typescript-old2/东营胜利宾馆'\n",
|
||||||
"new_path = 'file/东营石油设计院2025'\n",
|
"new_path = 'file/东营胜利宾馆'\n",
|
||||||
"old = []\n",
|
"old = []\n",
|
||||||
"dict2 = {}\n",
|
"dict2 = {}\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/result_东营石油工程设计院2025.json'\n",
|
"filename = 'data/result_东营胜利宾馆.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",
|
||||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||||
@@ -866,12 +882,27 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 24,
|
||||||
"id": "02319955-7fb6-4791-ae45-55b03bdadd54",
|
"id": "02319955-7fb6-4791-ae45-55b03bdadd54",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T02:26:40.883312Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T02:26:40.882740Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T02:26:40.906024Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T02:26:40.905551Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T02:26:40.883256Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import os,sys,shutil\n",
|
"import os,sys,shutil\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -879,9 +910,9 @@
|
|||||||
"from pathlib import Path\n",
|
"from pathlib import Path\n",
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fi_path = '/home/songyi/pdf-typescript-old2/东营石油设计院2025'\n",
|
"fi_path = '/home/songyi/pdf-typescript-old2/东营胜利宾馆'\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/result_东营石油工程设计院2025.json'\n",
|
"filename = 'data/result_东营胜利宾馆.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",
|
||||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||||
@@ -897,7 +928,7 @@
|
|||||||
" \n",
|
" \n",
|
||||||
" list1.append(list2)\n",
|
" list1.append(list2)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/东营石油工程设计院2025年体测报告明细表.xlsx'\n",
|
"filename = 'data/东营胜利宾馆体测报告明细表.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",
|
||||||
@@ -1552,16 +1583,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-30T03:25:50.554226Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:25:50.553608Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:25:50.575194Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:25:50.574507Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:25:50.554173Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"70\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/result_宁夏能化人员all.json'\n",
|
"filename = 'data/result_东营胜利宾馆.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",
|
||||||
@@ -1614,7 +1661,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_宁夏能化人员.json'\n",
|
"filename = f'data/data_东营胜利宾馆.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)) "
|
||||||
@@ -1630,17 +1677,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-30T03:25:56.345990Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:25:56.345178Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:25:56.355811Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:25:56.354676Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:25:56.345906Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"平均成绩:2.8165分,男性:34人\n",
|
||||||
|
"平均成绩:3.0694分,女性:36人\n",
|
||||||
|
"平均成绩:2.9466分,总体:70人\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_宁夏能化人员.json'\n",
|
"filename = 'data/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",
|
||||||
"i = 1\n",
|
"i = 1\n",
|
||||||
@@ -1674,12 +1738,32 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 27,
|
||||||
"id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1",
|
"id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:26:28.871704Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:26:28.871155Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:26:28.887396Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:26:28.886702Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:26:28.871647Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"0~255分人数:12人,男性:9人,女性:3人\n",
|
||||||
|
"256~332分人数:38人,男性:19人,女性:19人\n",
|
||||||
|
"333~367分人数:16人,男性:5人,女性:11人\n",
|
||||||
|
"368~500分人数:4人,男性:1人,女性:3人\n",
|
||||||
|
"70\n",
|
||||||
|
"ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -1725,12 +1809,34 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 28,
|
||||||
"id": "2d661ca6-6129-4da1-ac25-51d0156babb2",
|
"id": "2d661ca6-6129-4da1-ac25-51d0156babb2",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:27:10.453095Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:27:10.452579Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:27:10.463588Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:27:10.462674Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:27:10.453043Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"20-24 {}\n",
|
||||||
|
"25-29 {}\n",
|
||||||
|
"30-34 {'合格': 1}\n",
|
||||||
|
"35-39 {'合格': 5, '良好': 1, '不合格': 1}\n",
|
||||||
|
"40-44 {'良好': 4, '不合格': 2, '优秀': 1, '合格': 3}\n",
|
||||||
|
"45-49 {'合格': 9, '优秀': 2, '良好': 5, '不合格': 0}\n",
|
||||||
|
"50-54 {'合格': 1, '不合格': 0, '优秀': 0, '良好': 1}\n",
|
||||||
|
"55-80 {'良好': 0, '不合格': 0, '合格': 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",
|
||||||
@@ -1770,12 +1876,34 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 29,
|
||||||
"id": "fc97df37-34ff-4a02-9d26-b5d81b706e46",
|
"id": "fc97df37-34ff-4a02-9d26-b5d81b706e46",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:28:43.794940Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:28:43.794179Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:28:43.804569Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:28:43.803453Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:28:43.794866Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"20-24 {}\n",
|
||||||
|
"25-29 {}\n",
|
||||||
|
"30-34 {'合格': 1}\n",
|
||||||
|
"35-39 {'合格': 2, '良好': 0, '不合格': 0}\n",
|
||||||
|
"40-44 {'良好': 1, '不合格': 0, '优秀': 0, '合格': 2}\n",
|
||||||
|
"45-49 {'合格': 6, '优秀': 0, '良好': 1, '不合格': 5}\n",
|
||||||
|
"50-54 {'合格': 6, '不合格': 2, '优秀': 1, '良好': 2}\n",
|
||||||
|
"55-80 {'良好': 1, '不合格': 2, '合格': 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",
|
||||||
@@ -1815,12 +1943,34 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 30,
|
||||||
"id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5",
|
"id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:31:08.238140Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:31:08.237468Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:31:08.249928Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:31:08.248854Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:31:08.238077Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"16~24岁平均成绩:0分,人数:0人,男性:0人\n",
|
||||||
|
"25~29岁平均成绩:0分,人数:0人,男性:0人\n",
|
||||||
|
"30~34岁平均成绩:2.73分,人数:2人,男性:1人\n",
|
||||||
|
"35~39岁平均成绩:2.94分,人数:9人,男性:2人\n",
|
||||||
|
"40~44岁平均成绩:3.04分,人数:13人,男性:3人\n",
|
||||||
|
"45~49岁平均成绩:2.95分,人数:28人,男性:12人\n",
|
||||||
|
"50~54岁平均成绩:3.01分,人数:13人,男性:11人\n",
|
||||||
|
"55~69岁平均成绩:2.64分,人数:5人,男性:5人\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",
|
||||||
@@ -1855,12 +2005,34 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 31,
|
||||||
"id": "347703a1-501b-4800-bd29-16e94f4a6793",
|
"id": "347703a1-501b-4800-bd29-16e94f4a6793",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:33:02.816587Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:33:02.815993Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:33:02.824768Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:33:02.823787Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:33:02.816525Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"20~24岁平均成绩:0分,人数:0人\n",
|
||||||
|
"25~29岁平均成绩:0分,人数:0人\n",
|
||||||
|
"30~34岁平均成绩:2.56分,人数:1人\n",
|
||||||
|
"35~39岁平均成绩:3.24分,人数:2人\n",
|
||||||
|
"40~44岁平均成绩:3.18分,人数:3人\n",
|
||||||
|
"45~49岁平均成绩:2.62分,人数:12人\n",
|
||||||
|
"50~54岁平均成绩:2.96分,人数:11人\n",
|
||||||
|
"55~80岁平均成绩:2.64分,人数:5人\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -1895,12 +2067,34 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 32,
|
||||||
"id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d",
|
"id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:34:15.938497Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:34:15.937943Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:34:15.949638Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:34:15.948577Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:34:15.938442Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"20~24岁平均成绩:0分,人数:0人\n",
|
||||||
|
"25~29岁平均成绩:0分,人数:0人\n",
|
||||||
|
"30~34岁平均成绩:2.89分,人数:1人\n",
|
||||||
|
"35~39岁平均成绩:2.86分,人数:7人\n",
|
||||||
|
"40~44岁平均成绩:3.0分,人数:10人\n",
|
||||||
|
"45~49岁平均成绩:3.19分,人数:16人\n",
|
||||||
|
"50~54岁平均成绩:3.28分,人数:2人\n",
|
||||||
|
"55~80岁平均成绩:0分,人数: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",
|
||||||
@@ -1933,12 +2127,36 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 33,
|
||||||
"id": "ad69c45d-3f62-42df-894d-47424e759029",
|
"id": "ad69c45d-3f62-42df-894d-47424e759029",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:38:18.058882Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:38:18.058174Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:38:18.070777Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:38:18.069764Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:38:18.058815Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"BMI 3.66 70\n",
|
||||||
|
"肺活量 3.67 70\n",
|
||||||
|
"握力 2.64 69\n",
|
||||||
|
"坐位体前屈 2.69 68\n",
|
||||||
|
"纵跳 2.6 67\n",
|
||||||
|
"俯卧撑 2.93 28\n",
|
||||||
|
"一分钟仰卧起坐 3.65 34\n",
|
||||||
|
"单脚站立 2.19 70\n",
|
||||||
|
"选择反应时 3.41 70\n",
|
||||||
|
"台阶指数 2.48 63\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",
|
||||||
@@ -1963,12 +2181,43 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 34,
|
||||||
"id": "dcf152e7-bbcc-47d1-9c5f-83854db35412",
|
"id": "dcf152e7-bbcc-47d1-9c5f-83854db35412",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-06-30T03:39:23.962598Z",
|
||||||
|
"iopub.status.busy": "2025-06-30T03:39:23.961860Z",
|
||||||
|
"iopub.status.idle": "2025-06-30T03:39:23.970708Z",
|
||||||
|
"shell.execute_reply": "2025-06-30T03:39:23.969751Z",
|
||||||
|
"shell.execute_reply.started": "2025-06-30T03:39:23.962527Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"安全(QHSE)管理督查部 3.06 2\n",
|
||||||
|
"综合保障服务部 3.04 6\n",
|
||||||
|
"餐饮部 2.86 21\n",
|
||||||
|
"市场营销部 3.18 5\n",
|
||||||
|
"后勤服务技能鉴定站 3.17 2\n",
|
||||||
|
"综合管理部 2.81 5\n",
|
||||||
|
"展厅服务部 3.0 1\n",
|
||||||
|
"经理、党委副书记 3.33 1\n",
|
||||||
|
"安全总监 3.78 1\n",
|
||||||
|
"信息化服务部 3.11 5\n",
|
||||||
|
"人力资源总监 3.0 1\n",
|
||||||
|
"人力资源(组织)部 2.56 1\n",
|
||||||
|
"副经理 2.56 2\n",
|
||||||
|
"协理员 1.71 1\n",
|
||||||
|
"经营管理部 2.82 3\n",
|
||||||
|
"客房部 2.89 10\n",
|
||||||
|
"会务部 3.4 3\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",
|
||||||
@@ -2127,15 +2376,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 19,
|
"execution_count": 35,
|
||||||
"id": "6f9768ce-2ef5-4253-9fc6-49dbdcf00a19",
|
"id": "6f9768ce-2ef5-4253-9fc6-49dbdcf00a19",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-29T01:27:37.201286Z",
|
"iopub.execute_input": "2025-06-30T06:04:34.269580Z",
|
||||||
"iopub.status.busy": "2025-06-29T01:27:37.200533Z",
|
"iopub.status.busy": "2025-06-30T06:04:34.268925Z",
|
||||||
"iopub.status.idle": "2025-06-29T01:27:37.211946Z",
|
"iopub.status.idle": "2025-06-30T06:04:34.282224Z",
|
||||||
"shell.execute_reply": "2025-06-29T01:27:37.211395Z",
|
"shell.execute_reply": "2025-06-30T06:04:34.281280Z",
|
||||||
"shell.execute_reply.started": "2025-06-29T01:27:37.201222Z"
|
"shell.execute_reply.started": "2025-06-30T06:04:34.269514Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -2477,15 +2726,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 21,
|
"execution_count": 36,
|
||||||
"id": "9ecd3ad8-c8af-4f3e-90e5-1618fea905a4",
|
"id": "9ecd3ad8-c8af-4f3e-90e5-1618fea905a4",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-29T01:39:49.263673Z",
|
"iopub.execute_input": "2025-06-30T06:04:41.412312Z",
|
||||||
"iopub.status.busy": "2025-06-29T01:39:49.263044Z",
|
"iopub.status.busy": "2025-06-30T06:04:41.411683Z",
|
||||||
"iopub.status.idle": "2025-06-29T01:39:49.297534Z",
|
"iopub.status.idle": "2025-06-30T06:04:41.442284Z",
|
||||||
"shell.execute_reply": "2025-06-29T01:39:49.297056Z",
|
"shell.execute_reply": "2025-06-30T06:04:41.441732Z",
|
||||||
"shell.execute_reply.started": "2025-06-29T01:39:49.263597Z"
|
"shell.execute_reply.started": "2025-06-30T06:04:41.412252Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -2493,7 +2742,7 @@
|
|||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"\n",
|
"\n",
|
||||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
|
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
|
||||||
"filename = 'data/result_海淀区老干部大学第一期-1.json'\n",
|
"filename = 'data/result_海淀区老干部大学第二期-1.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",
|
||||||
"data_list = []\n",
|
"data_list = []\n",
|
||||||
@@ -2575,7 +2824,7 @@
|
|||||||
" list6.append('')\n",
|
" list6.append('')\n",
|
||||||
" i+=1\n",
|
" i+=1\n",
|
||||||
" data_list.append(list6)\n",
|
" data_list.append(list6)\n",
|
||||||
"filename = 'data/海淀区老干部大学第一期测试情况表.xlsx'\n",
|
"filename = 'data/海淀区老干部大学第二期测试情况表.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",
|
||||||
|
|||||||
+244
-191
@@ -10,15 +10,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 11,
|
"execution_count": 75,
|
||||||
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-26T09:23:57.936852Z",
|
"iopub.execute_input": "2025-07-03T14:10:10.030695Z",
|
||||||
"iopub.status.busy": "2025-06-26T09:23:57.936142Z",
|
"iopub.status.busy": "2025-07-03T14:10:10.030380Z",
|
||||||
"iopub.status.idle": "2025-06-26T09:23:58.004545Z",
|
"iopub.status.idle": "2025-07-03T14:10:10.104203Z",
|
||||||
"shell.execute_reply": "2025-06-26T09:23:58.004103Z",
|
"shell.execute_reply": "2025-07-03T14:10:10.103560Z",
|
||||||
"shell.execute_reply.started": "2025-06-26T09:23:57.936786Z"
|
"shell.execute_reply.started": "2025-07-03T14:10:10.030662Z"
|
||||||
},
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
@@ -67,27 +67,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": null,
|
||||||
"id": "ce406710-6b7d-4c51-98ec-78883bd3ce5f",
|
"id": "ce406710-6b7d-4c51-98ec-78883bd3ce5f",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2025-06-20T07:51:09.404359Z",
|
|
||||||
"iopub.status.busy": "2025-06-20T07:51:09.403401Z",
|
|
||||||
"iopub.status.idle": "2025-06-20T07:51:09.412040Z",
|
|
||||||
"shell.execute_reply": "2025-06-20T07:51:09.410889Z",
|
|
||||||
"shell.execute_reply.started": "2025-06-20T07:51:09.404278Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"ok\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -120,15 +105,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 19,
|
"execution_count": 76,
|
||||||
"id": "970e171e-1360-448f-a28c-520ccb8f314a",
|
"id": "970e171e-1360-448f-a28c-520ccb8f314a",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-27T04:18:55.832397Z",
|
"iopub.execute_input": "2025-07-03T14:10:45.274585Z",
|
||||||
"iopub.status.busy": "2025-06-27T04:18:55.832091Z",
|
"iopub.status.busy": "2025-07-03T14:10:45.273833Z",
|
||||||
"iopub.status.idle": "2025-06-27T04:18:55.841888Z",
|
"iopub.status.idle": "2025-07-03T14:10:45.293613Z",
|
||||||
"shell.execute_reply": "2025-06-27T04:18:55.841317Z",
|
"shell.execute_reply": "2025-07-03T14:10:45.292999Z",
|
||||||
"shell.execute_reply.started": "2025-06-27T04:18:55.832371Z"
|
"shell.execute_reply.started": "2025-07-03T14:10:45.274514Z"
|
||||||
},
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
@@ -137,7 +122,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"57\n"
|
"86\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -151,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_20250627.csv'\n",
|
"filename = 'data/marks_20250703.csv'\n",
|
||||||
"re_ta = My.get_result(filename,dict1)\n",
|
"re_ta = My.get_result(filename,dict1)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -171,15 +156,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 16,
|
"execution_count": 77,
|
||||||
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
|
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-26T09:26:45.723598Z",
|
"iopub.execute_input": "2025-07-03T14:10:49.291562Z",
|
||||||
"iopub.status.busy": "2025-06-26T09:26:45.723143Z",
|
"iopub.status.busy": "2025-07-03T14:10:49.290910Z",
|
||||||
"iopub.status.idle": "2025-06-26T09:26:45.735635Z",
|
"iopub.status.idle": "2025-07-03T14:10:49.313086Z",
|
||||||
"shell.execute_reply": "2025-06-26T09:26:45.734794Z",
|
"shell.execute_reply": "2025-07-03T14:10:49.312338Z",
|
||||||
"shell.execute_reply.started": "2025-06-26T09:26:45.723567Z"
|
"shell.execute_reply.started": "2025-07-03T14:10:49.291501Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -237,16 +222,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 17,
|
"execution_count": null,
|
||||||
"id": "867ad6b0-9e9d-48bc-a10a-3b9cb6125890",
|
"id": "867ad6b0-9e9d-48bc-a10a-3b9cb6125890",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2025-06-26T09:26:59.739745Z",
|
|
||||||
"iopub.status.busy": "2025-06-26T09:26:59.738920Z",
|
|
||||||
"iopub.status.idle": "2025-06-26T09:26:59.761164Z",
|
|
||||||
"shell.execute_reply": "2025-06-26T09:26:59.760746Z",
|
|
||||||
"shell.execute_reply.started": "2025-06-26T09:26:59.739659Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -289,7 +267,7 @@
|
|||||||
" list2.append('')\n",
|
" list2.append('')\n",
|
||||||
" \n",
|
" \n",
|
||||||
" list1.append(list2)\n",
|
" list1.append(list2)\n",
|
||||||
"filename = 'data/南京化工测试情况明细表(截至20250626).xlsx'\n",
|
"filename = 'data/南京化工测试情况明细表(截至20250630).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",
|
||||||
@@ -304,176 +282,267 @@
|
|||||||
"id": "699c6a40-a6ae-4300-9646-708cb85aa5e8",
|
"id": "699c6a40-a6ae-4300-9646-708cb85aa5e8",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## 统计各部门测试人员情况"
|
"## 统计问卷人员情况"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 20,
|
"execution_count": 78,
|
||||||
"id": "c4b71b0f-0f0c-4962-a540-611cbab51bfa",
|
|
||||||
"metadata": {
|
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2025-06-27T04:19:17.469888Z",
|
|
||||||
"iopub.status.busy": "2025-06-27T04:19:17.469137Z",
|
|
||||||
"iopub.status.idle": "2025-06-27T04:19:17.491232Z",
|
|
||||||
"shell.execute_reply": "2025-06-27T04:19:17.490732Z",
|
|
||||||
"shell.execute_reply.started": "2025-06-27T04:19:17.469824Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"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",
|
|
||||||
"list1 = []\n",
|
|
||||||
"for k, v in dict2.items():\n",
|
|
||||||
" if k not in dict1.keys():\n",
|
|
||||||
" list2 = []\n",
|
|
||||||
" unit = v['unit']\n",
|
|
||||||
" list2 = [k,v['name'],v['sex'],unit]\n",
|
|
||||||
" list1.append(list2)\n",
|
|
||||||
" \n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"\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": "markdown",
|
|
||||||
"id": "3796748f-2079-46b6-a3a1-b22441880843",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"## 统计各部门已测试情况"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 66,
|
|
||||||
"id": "def3f47a-24ef-4815-b63b-2a16b79b4c15",
|
"id": "def3f47a-24ef-4815-b63b-2a16b79b4c15",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-17T11:02:38.842412Z",
|
"iopub.execute_input": "2025-07-03T14:11:05.924023Z",
|
||||||
"iopub.status.busy": "2025-06-17T11:02:38.841860Z",
|
"iopub.status.busy": "2025-07-03T14:11:05.923517Z",
|
||||||
"iopub.status.idle": "2025-06-17T11:02:38.879864Z",
|
"iopub.status.idle": "2025-07-03T14:11:05.951213Z",
|
||||||
"shell.execute_reply": "2025-06-17T11:02:38.879320Z",
|
"shell.execute_reply": "2025-07-03T14:11:05.950561Z",
|
||||||
"shell.execute_reply.started": "2025-06-17T11:02:38.842360Z"
|
"shell.execute_reply.started": "2025-07-03T14:11:05.923975Z"
|
||||||
},
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
|
"import csv\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import time\n",
|
||||||
|
"from datetime import date\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/result_宁夏能化人员.json'\n",
|
"\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",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/宁夏能化人员.json'\n",
|
"phone1 = set()\n",
|
||||||
"with open(filename,'r') as fl:\n",
|
"phone2 = set()\n",
|
||||||
" dict2 = json.load(fl)\n",
|
|
||||||
"\n",
|
|
||||||
"dict3 = {}\n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"title =['单位','体测人数']\n",
|
|
||||||
"list1 = []\n",
|
|
||||||
"for k,v in dict1.items():\n",
|
"for k,v in dict1.items():\n",
|
||||||
" unit = v['unit']\n",
|
" phone1.add(v['phone'])\n",
|
||||||
" if unit=='管理部门':\n",
|
"list1 = []\n",
|
||||||
" sub_unit = dict2[k]['sub_unit']\n",
|
"filename = 'data/survey_records_20250703.csv'\n",
|
||||||
" else:\n",
|
"with open(filename,'r',newline='') as csv_file:\n",
|
||||||
" sub_unit = unit\n",
|
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||||
" dict3.setdefault(unit,{}) \n",
|
" header = next(fl) \n",
|
||||||
" dict3[unit].setdefault(sub_unit,{})\n",
|
" for line in fl:\n",
|
||||||
" dict3[unit][sub_unit].setdefault('人数',0)\n",
|
" list1.append(line)\n",
|
||||||
" dict3[unit][sub_unit]['人数'] = dict3[unit][sub_unit]['人数'] + 1\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"for k, v in dict3.items():\n",
|
"i =1\n",
|
||||||
" list2 = []\n",
|
"list2 = []\n",
|
||||||
" for k1,v1 in v.items():\n",
|
"for item in list1:\n",
|
||||||
" list2 = [k,k1,v1['人数']]\n",
|
" code = int(item[3])\n",
|
||||||
" list1.append(list2)\n",
|
" for k, v in dict1.items():\n",
|
||||||
"\n",
|
" list3 = []\n",
|
||||||
"filename = 'data/宁夏能化部门测试情况表.xlsx'\n",
|
" if v['phone'] == code: \n",
|
||||||
|
" list3.append(k)\n",
|
||||||
|
" list3.append(v['name'])\n",
|
||||||
|
" list3.append(v['sex'])\n",
|
||||||
|
" list3.append(v['unit'])\n",
|
||||||
|
" list3.append(code)\n",
|
||||||
|
" list2.append(list3)\n",
|
||||||
|
"filename = 'data/南化问卷情况表.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",
|
||||||
"for row in list1:\n",
|
"for row in list2:\n",
|
||||||
" sheet.append(row)\n",
|
" sheet.append(row)\n",
|
||||||
" \n",
|
" \n",
|
||||||
"wb.save(filename)"
|
"wb.save(filename) "
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 65,
|
"execution_count": 79,
|
||||||
"id": "61dde8c3-844a-4016-8952-cb726ab5f61d",
|
"id": "9cb0172e-5f6c-4b47-8431-83dc5cc4601c",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-17T11:01:30.219475Z",
|
"iopub.execute_input": "2025-07-03T14:11:09.342124Z",
|
||||||
"iopub.status.busy": "2025-06-17T11:01:30.218747Z",
|
"iopub.status.busy": "2025-07-03T14:11:09.341492Z",
|
||||||
"iopub.status.idle": "2025-06-17T11:01:30.259871Z",
|
"iopub.status.idle": "2025-07-03T14:11:09.352176Z",
|
||||||
"shell.execute_reply": "2025-06-17T11:01:30.259320Z",
|
"shell.execute_reply": "2025-07-03T14:11:09.350856Z",
|
||||||
"shell.execute_reply.started": "2025-06-17T11:01:30.219409Z"
|
"shell.execute_reply.started": "2025-07-03T14:11:09.342065Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"13718042132\n",
|
||||||
|
"13705162311\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import csv\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import time\n",
|
||||||
|
"from datetime import date\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/南京化工人员.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl)\n",
|
||||||
|
"\n",
|
||||||
|
"phone1 = set()\n",
|
||||||
|
"phone2 = set()\n",
|
||||||
|
"for k,v in dict1.items():\n",
|
||||||
|
" phone1.add(v['phone'])\n",
|
||||||
|
"list1 = []\n",
|
||||||
|
"filename = 'data/survey_records_20250701.csv'\n",
|
||||||
|
"with open(filename,'r',newline='') as csv_file:\n",
|
||||||
|
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||||
|
" header = next(fl) \n",
|
||||||
|
" for line in fl:\n",
|
||||||
|
" list1.append(line)\n",
|
||||||
|
"\n",
|
||||||
|
"for item in list1:\n",
|
||||||
|
" code = int(item[3]) \n",
|
||||||
|
" if code not in phone1: \n",
|
||||||
|
" print(code)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "797717d5-47b9-4d47-be6c-8d54bede67d4",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 导入问卷信息"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 80,
|
||||||
|
"id": "9d9dd574-9fbf-4d0a-96fd-9b55d98021d2",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-03T14:11:25.002448Z",
|
||||||
|
"iopub.status.busy": "2025-07-03T14:11:25.001635Z",
|
||||||
|
"iopub.status.idle": "2025-07-03T14:11:25.029582Z",
|
||||||
|
"shell.execute_reply": "2025-07-03T14:11:25.029137Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-03T14:11:25.002370Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
|
"import csv\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import time\n",
|
||||||
|
"from datetime import date\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/result_宁夏能化人员.json'\n",
|
"dict1 = {}\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/result_南京化工.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",
|
"filename = 'data/南京化工人员.json'\n",
|
||||||
"filename = 'data/宁夏能化人员.json'\n",
|
|
||||||
"with open(filename,'r') as fl:\n",
|
"with open(filename,'r') as fl:\n",
|
||||||
" dict2 = json.load(fl)\n",
|
" dict3 = json.load(fl)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"dict3 = {}\n",
|
"phone = {}\n",
|
||||||
|
"for k,v in dict3.items():\n",
|
||||||
|
" if 'phone' in v.keys():\n",
|
||||||
|
" phone[v['phone']] = k\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
|
||||||
"title =['单位','体测人数']\n",
|
|
||||||
"list1 = []\n",
|
"list1 = []\n",
|
||||||
"for k,v in dict2.items():\n",
|
"filename = 'data/survey_records_20250703.csv'\n",
|
||||||
" unit = v['unit']\n",
|
"with open(filename,'r',newline='') as csv_file:\n",
|
||||||
" if unit=='管理部门':\n",
|
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||||
" sub_unit = dict2[k]['sub_unit']\n",
|
" header = next(fl) \n",
|
||||||
" else:\n",
|
" for line in fl:\n",
|
||||||
" sub_unit = unit\n",
|
" list1.append(line)\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",
|
"\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",
|
"\n",
|
||||||
"filename = 'data/宁夏能化部门人员情况表.xlsx'\n",
|
"\n",
|
||||||
"wb = openpyxl.Workbook()\n",
|
"nn = 0\n",
|
||||||
|
"for item in list1:\n",
|
||||||
|
" if int(item[3]) in phone.keys(): \n",
|
||||||
|
" tcm = []\n",
|
||||||
|
" code = phone[int(item[3])]\n",
|
||||||
|
" \n",
|
||||||
|
" for i in range(0,60):\n",
|
||||||
|
" tcm.append(0)\n",
|
||||||
|
" \n",
|
||||||
|
" \n",
|
||||||
|
" content = json.loads(item[4])\n",
|
||||||
|
" if code not in dict1.keys():\n",
|
||||||
|
" dict1[code] = dict3[code]\n",
|
||||||
|
" rq = date.fromisoformat(item[5].replace('/','-').split(' ')[0])\n",
|
||||||
|
" dict1[code]['rq'] = str(date.fromisoformat(item[5].replace('/','-').split(' ')[0]))\n",
|
||||||
|
" #dict1[code]['rq'] = item[5].replace('/','-').split(' ')[0]\n",
|
||||||
|
" else:\n",
|
||||||
|
" rq=date.fromisoformat('2025-07-01')\n",
|
||||||
|
" dict1[code]['rq'] = '2025-07-01'\n",
|
||||||
|
" for k, v in content.items():\n",
|
||||||
|
" \n",
|
||||||
|
" if 'tcm' in k:\n",
|
||||||
|
" i = int(k[3:])\n",
|
||||||
|
" tcm[i-1] = int(v) \n",
|
||||||
|
" \n",
|
||||||
|
" if 'tcm' in item[4]: \n",
|
||||||
|
" dict1[code]['tcm'] = tcm\n",
|
||||||
|
" \n",
|
||||||
|
" birth = date.fromisoformat(dict3[code]['birth'].replace('/','-'))\n",
|
||||||
|
" \n",
|
||||||
|
" days = (rq-birth).days \n",
|
||||||
|
" dict1[code]['age'] = int(days/365)\n",
|
||||||
|
" dict1[code]['month'] = int(days/365*12)\n",
|
||||||
|
" #print(phone[item[2]])\n",
|
||||||
|
" nn+=1\n",
|
||||||
|
"filename = 'data/result_南京化工-1.json'\n",
|
||||||
|
"\n",
|
||||||
|
"with open(filename,'w') as fl:\n",
|
||||||
|
" json.dump(dict1, fl, ensure_ascii=False)\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "89689b86-3fae-402e-a456-a646f0c7201f",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 导入腰臀数据"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 81,
|
||||||
|
"id": "4a0678c6-0c64-4314-bb03-24b10a3d695a",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-03T14:11:29.937365Z",
|
||||||
|
"iopub.status.busy": "2025-07-03T14:11:29.936849Z",
|
||||||
|
"iopub.status.idle": "2025-07-03T14:11:29.966917Z",
|
||||||
|
"shell.execute_reply": "2025-07-03T14:11:29.966365Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-03T14:11:29.937316Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import csv\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import time\n",
|
||||||
|
"from datetime import date\n",
|
||||||
|
"\n",
|
||||||
|
"dict1 = {}\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/result_南京化工-1.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl)\n",
|
||||||
|
"wb = openpyxl.load_workbook('data/南化腰臀数据.xlsx',data_only=True)\n",
|
||||||
"sheet = wb.active\n",
|
"sheet = wb.active\n",
|
||||||
"sheet.append(title)\n",
|
"# sheets = wb.sheetnames\n",
|
||||||
"for row in list1:\n",
|
"person = {}\n",
|
||||||
" sheet.append(row)\n",
|
"\n",
|
||||||
" \n",
|
"for n in range(2, sheet.max_row+1):\n",
|
||||||
"wb.save(filename)"
|
" code = str(sheet.cell(n, 1).value)\n",
|
||||||
|
" if code in dict1.keys():\n",
|
||||||
|
" yao = str(sheet.cell(n, 2).value)\n",
|
||||||
|
" tun = str(sheet.cell(n, 3).value)\n",
|
||||||
|
" dict1[code]['腰臀比'] = yao+','+tun\n",
|
||||||
|
"filename = 'data/result_南京化工-1.json'\n",
|
||||||
|
"\n",
|
||||||
|
"with open(filename,'w') as fl:\n",
|
||||||
|
" json.dump(dict1, fl, ensure_ascii=False)\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -486,26 +555,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 10,
|
"execution_count": null,
|
||||||
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
|
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"execution": {
|
"outputs": [],
|
||||||
"iopub.execute_input": "2025-06-26T07:15:55.749748Z",
|
|
||||||
"iopub.status.busy": "2025-06-26T07:15:55.749253Z",
|
|
||||||
"iopub.status.idle": "2025-06-26T07:15:56.590649Z",
|
|
||||||
"shell.execute_reply": "2025-06-26T07:15:56.589700Z",
|
|
||||||
"shell.execute_reply.started": "2025-06-26T07:15:55.749700Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"1\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import requests\n",
|
"import requests\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
|
|||||||
@@ -0,0 +1,483 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "04524c85-988e-4dbf-86eb-939a9db7aa28",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 体测人员导入"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 10,
|
||||||
|
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-02T07:56:23.192197Z",
|
||||||
|
"iopub.status.busy": "2025-07-02T07:56:23.191439Z",
|
||||||
|
"iopub.status.idle": "2025-07-02T07:56:23.212284Z",
|
||||||
|
"shell.execute_reply": "2025-07-02T07:56:23.211376Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-02T07:56:23.192125Z"
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2 ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import json\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"wb = openpyxl.load_workbook('data/新疆油田采油工艺研究院.xlsx',data_only=True)\n",
|
||||||
|
"sheet = wb.active\n",
|
||||||
|
"# sheets = wb.sheetnames\n",
|
||||||
|
"person = {}\n",
|
||||||
|
"\n",
|
||||||
|
"for n in range(2, sheet.max_row+1):\n",
|
||||||
|
" code = int(sheet.cell(n, 1).value)\n",
|
||||||
|
" person.setdefault(code, {})\n",
|
||||||
|
" dict1 = {}\n",
|
||||||
|
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||||
|
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||||
|
" dict1['unit'] = ' '#sheet.cell(n, 2).value \n",
|
||||||
|
" dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0]\n",
|
||||||
|
" #dict1['phone'] = sheet.cell(n, 12).value \n",
|
||||||
|
" person[code] = dict1\n",
|
||||||
|
"filename = 'data/新疆油田采油工艺研究院.json'\n",
|
||||||
|
"with open(filename, 'w') as fl:\n",
|
||||||
|
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||||
|
"print(len(person),'ok')"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "6bcd45c2-10af-4d5f-9e0b-5cd1df4f7a7f",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 获取人员测试成绩"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 11,
|
||||||
|
"id": "970e171e-1360-448f-a28c-520ccb8f314a",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-02T07:56:26.747275Z",
|
||||||
|
"iopub.status.busy": "2025-07-02T07:56:26.746522Z",
|
||||||
|
"iopub.status.idle": "2025-07-02T07:56:26.758502Z",
|
||||||
|
"shell.execute_reply": "2025-07-02T07:56:26.757404Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-02T07:56:26.747205Z"
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import datetime\n",
|
||||||
|
"import csv\n",
|
||||||
|
"from datetime import date\n",
|
||||||
|
"import my_module as My\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/新疆油田采油工艺研究院.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl) \n",
|
||||||
|
"filename = 'data/marks_20250702.csv'\n",
|
||||||
|
"re_ta = My.get_result(filename,dict1)\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/result_新疆油田采油工艺研究院.json'\n",
|
||||||
|
"with open(filename,'w') as fl:\n",
|
||||||
|
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||||
|
"print(len(re_ta))"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "6d381859-6d21-45d2-8313-55ebbabf8bd4",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 生成测试得分"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 12,
|
||||||
|
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-02T07:56:29.423717Z",
|
||||||
|
"iopub.status.busy": "2025-07-02T07:56:29.422959Z",
|
||||||
|
"iopub.status.idle": "2025-07-02T07:56:29.434498Z",
|
||||||
|
"shell.execute_reply": "2025-07-02T07:56:29.433382Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-02T07:56:29.423642Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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",
|
||||||
|
"id": "d034a61d-1fbd-417b-99bd-277e43ebb678",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 导出测试人员信息"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "867ad6b0-9e9d-48bc-a10a-3b9cb6125890",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"\n",
|
||||||
|
"items = ['lung','grip','flexion','jump','pushup','situp','balance','reaction','step']\n",
|
||||||
|
"title = ['编号','姓名','性别','单位','部门','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\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",
|
||||||
|
"list1 = []\n",
|
||||||
|
"for k, v in dict1.items():\n",
|
||||||
|
" list2 = []\n",
|
||||||
|
" list2.append(str(k).rjust(5,'0'))\n",
|
||||||
|
" list2.append(v['name']) \n",
|
||||||
|
" list2.append(dict2[k]['sex'])\n",
|
||||||
|
" list2.append(dict2[k]['unit'])\n",
|
||||||
|
" if 'bmi' in v.keys():\n",
|
||||||
|
" height = v['bmi']['成绩'].split(',')[0]\n",
|
||||||
|
" weight = v['bmi']['成绩'].split(',')[1]\n",
|
||||||
|
" list2.append(height)\n",
|
||||||
|
" list2.append(weight)\n",
|
||||||
|
" else:\n",
|
||||||
|
" list2.append('')\n",
|
||||||
|
" list2.append('')\n",
|
||||||
|
" for item in items:\n",
|
||||||
|
" if item in v.keys():\n",
|
||||||
|
" list2.append(v[item]['成绩']) \n",
|
||||||
|
" elif item =='name':\n",
|
||||||
|
" list2.append(v[item])\n",
|
||||||
|
" else:\n",
|
||||||
|
" list2.append('')\n",
|
||||||
|
" \n",
|
||||||
|
" list1.append(list2)\n",
|
||||||
|
"filename = 'data/南京化工测试情况明细表(截至20250630).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": "699c6a40-a6ae-4300-9646-708cb85aa5e8",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 统计问卷人员情况"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "def3f47a-24ef-4815-b63b-2a16b79b4c15",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import csv\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import time\n",
|
||||||
|
"from datetime import date\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/南京化工人员.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl)\n",
|
||||||
|
"\n",
|
||||||
|
"phone1 = set()\n",
|
||||||
|
"phone2 = set()\n",
|
||||||
|
"for k,v in dict1.items():\n",
|
||||||
|
" phone1.add(v['phone'])\n",
|
||||||
|
"list1 = []\n",
|
||||||
|
"filename = 'data/survey_records_20250701.csv'\n",
|
||||||
|
"with open(filename,'r',newline='') as csv_file:\n",
|
||||||
|
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||||
|
" header = next(fl) \n",
|
||||||
|
" for line in fl:\n",
|
||||||
|
" list1.append(line)\n",
|
||||||
|
"\n",
|
||||||
|
"i =1\n",
|
||||||
|
"list2 = []\n",
|
||||||
|
"for item in list1:\n",
|
||||||
|
" code = int(item[3])\n",
|
||||||
|
" for k, v in dict1.items():\n",
|
||||||
|
" list3 = []\n",
|
||||||
|
" if v['phone'] == code: \n",
|
||||||
|
" list3.append(k)\n",
|
||||||
|
" list3.append(v['name'])\n",
|
||||||
|
" list3.append(v['sex'])\n",
|
||||||
|
" list3.append(v['unit'])\n",
|
||||||
|
" list3.append(code)\n",
|
||||||
|
" list2.append(list3)\n",
|
||||||
|
"filename = 'data/南化问卷情况表.xlsx'\n",
|
||||||
|
"wb = openpyxl.Workbook()\n",
|
||||||
|
"sheet = wb.active\n",
|
||||||
|
"#sheet.append(title)\n",
|
||||||
|
"for row in list2:\n",
|
||||||
|
" sheet.append(row)\n",
|
||||||
|
" \n",
|
||||||
|
"wb.save(filename) "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 32,
|
||||||
|
"id": "9cb0172e-5f6c-4b47-8431-83dc5cc4601c",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-01T06:26:28.751949Z",
|
||||||
|
"iopub.status.busy": "2025-07-01T06:26:28.751236Z",
|
||||||
|
"iopub.status.idle": "2025-07-01T06:26:28.761510Z",
|
||||||
|
"shell.execute_reply": "2025-07-01T06:26:28.760394Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-01T06:26:28.751881Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"13718042132\n",
|
||||||
|
"17625911723\n",
|
||||||
|
"13851588009\n",
|
||||||
|
"15077893706\n",
|
||||||
|
"13705162311\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import csv\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import time\n",
|
||||||
|
"from datetime import date\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/南京化工人员.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl)\n",
|
||||||
|
"\n",
|
||||||
|
"phone1 = set()\n",
|
||||||
|
"phone2 = set()\n",
|
||||||
|
"for k,v in dict1.items():\n",
|
||||||
|
" phone1.add(v['phone'])\n",
|
||||||
|
"list1 = []\n",
|
||||||
|
"filename = 'data/survey_records_20250701.csv'\n",
|
||||||
|
"with open(filename,'r',newline='') as csv_file:\n",
|
||||||
|
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||||
|
" header = next(fl) \n",
|
||||||
|
" for line in fl:\n",
|
||||||
|
" list1.append(line)\n",
|
||||||
|
"\n",
|
||||||
|
"for item in list1:\n",
|
||||||
|
" code = int(item[3]) \n",
|
||||||
|
" if code not in phone1: \n",
|
||||||
|
" print(code)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "8d5f4103-0d1e-4711-b324-ece360f8dcd3",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 生成报告"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 13,
|
||||||
|
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-02T07:56:40.122932Z",
|
||||||
|
"iopub.status.busy": "2025-07-02T07:56:40.122167Z",
|
||||||
|
"iopub.status.idle": "2025-07-02T07:56:41.662219Z",
|
||||||
|
"shell.execute_reply": "2025-07-02T07:56:41.661217Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-02T07:56:40.122861Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2\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",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "87556725-f68a-484b-827c-f6735155e940",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.12.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
+37
-37
@@ -10,15 +10,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": 16,
|
||||||
"id": "eb9aa782-ce2c-4814-bdf6-92c7e892854d",
|
"id": "eb9aa782-ce2c-4814-bdf6-92c7e892854d",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-27T07:52:20.116852Z",
|
"iopub.execute_input": "2025-06-30T06:01:26.433165Z",
|
||||||
"iopub.status.busy": "2025-06-27T07:52:20.116187Z",
|
"iopub.status.busy": "2025-06-30T06:01:26.432555Z",
|
||||||
"iopub.status.idle": "2025-06-27T07:52:20.147516Z",
|
"iopub.status.idle": "2025-06-30T06:01:26.459168Z",
|
||||||
"shell.execute_reply": "2025-06-27T07:52:20.146947Z",
|
"shell.execute_reply": "2025-06-30T06:01:26.458635Z",
|
||||||
"shell.execute_reply.started": "2025-06-27T07:52:20.116789Z"
|
"shell.execute_reply.started": "2025-06-30T06:01:26.433107Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -122,15 +122,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": 17,
|
||||||
"id": "fd005ed3-24ee-4b39-a619-6c83e64c2852",
|
"id": "fd005ed3-24ee-4b39-a619-6c83e64c2852",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-27T08:01:00.773765Z",
|
"iopub.execute_input": "2025-06-30T06:01:30.713754Z",
|
||||||
"iopub.status.busy": "2025-06-27T08:01:00.772994Z",
|
"iopub.status.busy": "2025-06-30T06:01:30.713036Z",
|
||||||
"iopub.status.idle": "2025-06-27T08:01:00.788351Z",
|
"iopub.status.idle": "2025-06-30T06:01:30.730192Z",
|
||||||
"shell.execute_reply": "2025-06-27T08:01:00.787439Z",
|
"shell.execute_reply": "2025-06-30T06:01:30.729306Z",
|
||||||
"shell.execute_reply.started": "2025-06-27T08:01:00.773693Z"
|
"shell.execute_reply.started": "2025-06-30T06:01:30.713687Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -206,15 +206,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 18,
|
||||||
"id": "9481765c-92b7-4a58-b192-582bb001f167",
|
"id": "9481765c-92b7-4a58-b192-582bb001f167",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-27T08:01:04.771410Z",
|
"iopub.execute_input": "2025-06-30T06:01:33.186253Z",
|
||||||
"iopub.status.busy": "2025-06-27T08:01:04.770655Z",
|
"iopub.status.busy": "2025-06-30T06:01:33.185404Z",
|
||||||
"iopub.status.idle": "2025-06-27T08:01:04.784375Z",
|
"iopub.status.idle": "2025-06-30T06:01:33.201547Z",
|
||||||
"shell.execute_reply": "2025-06-27T08:01:04.783184Z",
|
"shell.execute_reply": "2025-06-30T06:01:33.200481Z",
|
||||||
"shell.execute_reply.started": "2025-06-27T08:01:04.771340Z"
|
"shell.execute_reply.started": "2025-06-30T06:01:33.186179Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -272,15 +272,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 15,
|
"execution_count": 21,
|
||||||
"id": "63c81b75-9b3d-4001-a5da-32b7cf992843",
|
"id": "63c81b75-9b3d-4001-a5da-32b7cf992843",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-29T01:24:19.165326Z",
|
"iopub.execute_input": "2025-06-30T06:03:51.688275Z",
|
||||||
"iopub.status.busy": "2025-06-29T01:24:19.164670Z",
|
"iopub.status.busy": "2025-06-30T06:03:51.687558Z",
|
||||||
"iopub.status.idle": "2025-06-29T01:24:19.203326Z",
|
"iopub.status.idle": "2025-06-30T06:03:51.718118Z",
|
||||||
"shell.execute_reply": "2025-06-29T01:24:19.202250Z",
|
"shell.execute_reply": "2025-06-30T06:03:51.717651Z",
|
||||||
"shell.execute_reply.started": "2025-06-29T01:24:19.165268Z"
|
"shell.execute_reply.started": "2025-06-30T06:03:51.688211Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -355,15 +355,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 13,
|
"execution_count": 19,
|
||||||
"id": "dd8ed4fe-5014-455f-993d-64a41519de6d",
|
"id": "dd8ed4fe-5014-455f-993d-64a41519de6d",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-27T08:18:07.185139Z",
|
"iopub.execute_input": "2025-06-30T06:01:40.122434Z",
|
||||||
"iopub.status.busy": "2025-06-27T08:18:07.184397Z",
|
"iopub.status.busy": "2025-06-30T06:01:40.121692Z",
|
||||||
"iopub.status.idle": "2025-06-27T08:18:07.209650Z",
|
"iopub.status.idle": "2025-06-30T06:01:40.143208Z",
|
||||||
"shell.execute_reply": "2025-06-27T08:18:07.208728Z",
|
"shell.execute_reply": "2025-06-30T06:01:40.142553Z",
|
||||||
"shell.execute_reply.started": "2025-06-27T08:18:07.185073Z"
|
"shell.execute_reply.started": "2025-06-30T06:01:40.122360Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -371,7 +371,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"27\n"
|
"28\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -470,15 +470,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 14,
|
"execution_count": 20,
|
||||||
"id": "b8b2fc93-9e8b-4bde-bc13-2de179de2b2d",
|
"id": "b8b2fc93-9e8b-4bde-bc13-2de179de2b2d",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2025-06-27T08:18:23.717064Z",
|
"iopub.execute_input": "2025-06-30T06:01:46.226970Z",
|
||||||
"iopub.status.busy": "2025-06-27T08:18:23.716302Z",
|
"iopub.status.busy": "2025-06-30T06:01:46.226283Z",
|
||||||
"iopub.status.idle": "2025-06-27T08:18:40.822028Z",
|
"iopub.status.idle": "2025-06-30T06:02:03.514203Z",
|
||||||
"shell.execute_reply": "2025-06-27T08:18:40.821014Z",
|
"shell.execute_reply": "2025-06-30T06:02:03.513671Z",
|
||||||
"shell.execute_reply.started": "2025-06-27T08:18:23.716991Z"
|
"shell.execute_reply.started": "2025-06-30T06:01:46.226904Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
|
|||||||
+22
-4
@@ -159,20 +159,38 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 3,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-07-02T03:09:22.716144Z",
|
||||||
|
"iopub.status.busy": "2025-07-02T03:09:22.715330Z",
|
||||||
|
"iopub.status.idle": "2025-07-02T03:09:22.722736Z",
|
||||||
|
"shell.execute_reply": "2025-07-02T03:09:22.721566Z",
|
||||||
|
"shell.execute_reply.started": "2025-07-02T03:09:22.716070Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"bs b'\\xcd\\xf5\\xf0\\xa9\\xd1\\xf3\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n",
|
||||||
|
"decode-bs: 王皓洋\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n",
|
||||||
|
"gbcode: b'\\xcd\\xf5\\xf0\\xa9\\xd1\\xf3'\n",
|
||||||
|
"gbs: cdf5f0a9d1f3\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import binascii\n",
|
"import binascii\n",
|
||||||
"\n",
|
"\n",
|
||||||
"gbs = 'D4C0CDAF'\n",
|
"gbs = 'CDF5F0A9D1F300000000000000000000'\n",
|
||||||
"bs = binascii.a2b_hex(gbs)\n",
|
"bs = binascii.a2b_hex(gbs)\n",
|
||||||
"print('bs', bs)\n",
|
"print('bs', bs)\n",
|
||||||
"print('decode-bs:', bs.decode('gbk'))\n",
|
"print('decode-bs:', bs.decode('gbk'))\n",
|
||||||
"\n",
|
"\n",
|
||||||
"s = '马立亚'\n",
|
"s = '王皓洋'\n",
|
||||||
"gbcode = s.encode('gbk') # 先转成 bytes格式\n",
|
"gbcode = s.encode('gbk') # 先转成 bytes格式\n",
|
||||||
"print('gbcode:', gbcode)\n",
|
"print('gbcode:', gbcode)\n",
|
||||||
"gbs = \"\".join([hex(ch)[2:] for ch in gbcode]) #\n",
|
"gbs = \"\".join([hex(ch)[2:] for ch in gbcode]) #\n",
|
||||||
|
|||||||
Reference in new issue
Block a user