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",
|
||||
"execution_count": 18,
|
||||
"execution_count": 1,
|
||||
"id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-06-20T10:51:03.742479Z",
|
||||
"iopub.status.busy": "2025-06-20T10:51:03.741782Z",
|
||||
"iopub.status.idle": "2025-06-20T10:51:03.759950Z",
|
||||
"shell.execute_reply": "2025-06-20T10:51:03.759128Z",
|
||||
"shell.execute_reply.started": "2025-06-20T10:51:03.742415Z"
|
||||
"iopub.execute_input": "2025-06-30T01:44:44.903147Z",
|
||||
"iopub.status.busy": "2025-06-30T01:44:44.902892Z",
|
||||
"iopub.status.idle": "2025-06-30T01:44:44.920727Z",
|
||||
"shell.execute_reply": "2025-06-30T01:44:44.920259Z",
|
||||
"shell.execute_reply.started": "2025-06-30T01:44:44.903119Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -301,187 +301,6 @@
|
||||
"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",
|
||||
"id": "8d5f4103-0d1e-4711-b324-ece360f8dcd3",
|
||||
@@ -492,15 +311,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 2,
|
||||
"id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-06-18T01:49:13.699255Z",
|
||||
"iopub.status.busy": "2025-06-18T01:49:13.698689Z",
|
||||
"iopub.status.idle": "2025-06-18T02:04:11.786609Z",
|
||||
"shell.execute_reply": "2025-06-18T02:04:11.785557Z",
|
||||
"shell.execute_reply.started": "2025-06-18T01:49:13.699200Z"
|
||||
"iopub.execute_input": "2025-06-30T01:45:55.830006Z",
|
||||
"iopub.status.busy": "2025-06-30T01:45:55.829354Z",
|
||||
"iopub.status.idle": "2025-06-30T01:46:34.709813Z",
|
||||
"shell.execute_reply": "2025-06-30T01:46:34.708788Z",
|
||||
"shell.execute_reply.started": "2025-06-30T01:45:55.829948Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -508,7 +327,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"1690\n"
|
||||
"70\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -521,11 +340,11 @@
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_宁夏能化人员.json'\n",
|
||||
"filename = 'data/result_东营胜利宾馆.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"file_path ='./宁夏能化人员/'\n",
|
||||
"file_path ='./东营胜利宾馆/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=0\n",
|
||||
"list2 = []\n",
|
||||
@@ -535,7 +354,7 @@
|
||||
" \n",
|
||||
" id = str(k).rjust(4,\"0\")\n",
|
||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中国石化长城能源化工(宁夏)有限公司'\n",
|
||||
" mydata['title'] = '东营胜利宾馆'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
|
||||
Reference in new issue
Block a user