20230516
This commit is contained in:
1 parent
c7c9e34af4
commit
2e7d800503
3 files changed
+1053
-85
No files matched your search
+77
-53
@@ -10,15 +10,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": 32,
|
||||
"id": "1b92b7c5-cb77-49da-95b7-34827ecf1d16",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-14T14:13:07.924740Z",
|
||||
"iopub.status.busy": "2023-05-14T14:13:07.924333Z",
|
||||
"iopub.status.idle": "2023-05-14T14:13:10.350279Z",
|
||||
"shell.execute_reply": "2023-05-14T14:13:10.349499Z",
|
||||
"shell.execute_reply.started": "2023-05-14T14:13:07.924713Z"
|
||||
"iopub.execute_input": "2023-05-16T06:27:55.181932Z",
|
||||
"iopub.status.busy": "2023-05-16T06:27:55.181018Z",
|
||||
"iopub.status.idle": "2023-05-16T06:27:57.546786Z",
|
||||
"shell.execute_reply": "2023-05-16T06:27:57.545822Z",
|
||||
"shell.execute_reply.started": "2023-05-16T06:27:55.181895Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -27,8 +27,9 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"8205\n",
|
||||
"8170\n",
|
||||
"8206\n",
|
||||
"8171\n",
|
||||
"8109\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
@@ -76,11 +77,19 @@
|
||||
" dict1['工作性质'] = sheet.cell(n, 11).value\n",
|
||||
" person[code] = dict1\n",
|
||||
"jianyuan = [6484,7110,6441,6541,6543,6549,6555,6600,2958,2981,3033,3231,3249,3287,3228,7741,7749,7794,7799,7806,7837,7863,7870,7880,7894,7895,7904,7936,7947,7953,7958,7968,7969,7974,8086,8114]\n",
|
||||
"\n",
|
||||
"print(len(person))\n",
|
||||
"for k in jianyuan:\n",
|
||||
" if k in person.keys():\n",
|
||||
" del person[k]\n",
|
||||
"print(len(person))\n",
|
||||
"bianwai =[449,6839]\n",
|
||||
"for i in range(7139,7200):\n",
|
||||
" bianwai.append(i)\n",
|
||||
"for k in bianwai:\n",
|
||||
" if k in person.keys():\n",
|
||||
" del person[k]\n",
|
||||
"print(len(person))\n",
|
||||
"filename = 'data/燕山石化人员名单.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
@@ -97,15 +106,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": 33,
|
||||
"id": "71e1ec6a-6797-4496-969a-1d1461b9ea58",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-13T02:04:57.276284Z",
|
||||
"iopub.status.busy": "2023-05-13T02:04:57.275446Z",
|
||||
"iopub.status.idle": "2023-05-13T02:04:57.669774Z",
|
||||
"shell.execute_reply": "2023-05-13T02:04:57.668967Z",
|
||||
"shell.execute_reply.started": "2023-05-13T02:04:57.276243Z"
|
||||
"iopub.execute_input": "2023-05-16T08:36:31.303752Z",
|
||||
"iopub.status.busy": "2023-05-16T08:36:31.302937Z",
|
||||
"iopub.status.idle": "2023-05-16T08:36:31.711617Z",
|
||||
"shell.execute_reply": "2023-05-16T08:36:31.710715Z",
|
||||
"shell.execute_reply.started": "2023-05-16T08:36:31.303711Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -114,9 +123,12 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"252\n",
|
||||
"252\n",
|
||||
"7118\n"
|
||||
"214\n",
|
||||
"8151 赵春先 已测试!\n",
|
||||
"999 张术申 已测试!\n",
|
||||
"2709 刘巍 已测试!\n",
|
||||
"214\n",
|
||||
"7598\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -139,7 +151,7 @@
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20230512.csv'\n",
|
||||
"filename = 'data/places_result_20230516.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -172,7 +184,7 @@
|
||||
" else:\n",
|
||||
" for k1,v1 in v.items():\n",
|
||||
" dict2[k][k1] = v1\n",
|
||||
"filename = 'data/result_燕山石化(20230512).json'\n",
|
||||
"filename = 'data/result_燕山石化(20230516).json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
"print(len(re_ta))\n",
|
||||
@@ -192,15 +204,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 34,
|
||||
"id": "c24880ad-bbbd-4ad8-a894-cbcea389e822",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-13T02:05:33.519879Z",
|
||||
"iopub.status.busy": "2023-05-13T02:05:33.519039Z",
|
||||
"iopub.status.idle": "2023-05-13T02:05:33.660778Z",
|
||||
"shell.execute_reply": "2023-05-13T02:05:33.660105Z",
|
||||
"shell.execute_reply.started": "2023-05-13T02:05:33.519838Z"
|
||||
"iopub.execute_input": "2023-05-16T08:37:27.708591Z",
|
||||
"iopub.status.busy": "2023-05-16T08:37:27.707778Z",
|
||||
"iopub.status.idle": "2023-05-16T08:37:27.839300Z",
|
||||
"shell.execute_reply": "2023-05-16T08:37:27.838623Z",
|
||||
"shell.execute_reply.started": "2023-05-16T08:37:27.708561Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -212,7 +224,7 @@
|
||||
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"\n",
|
||||
"filename = 'data/result_燕山石化(20230512).json'\n",
|
||||
"filename = 'data/result_燕山石化(20230516).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -237,7 +249,7 @@
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/燕山石化体测情况表(20230512).xlsx'\n",
|
||||
"filename = 'data/燕山石化体测情况表(20230516).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -322,15 +334,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": 35,
|
||||
"id": "68454877-f1fe-4eed-8a48-265e428f892e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-13T02:05:45.816647Z",
|
||||
"iopub.status.busy": "2023-05-13T02:05:45.815801Z",
|
||||
"iopub.status.idle": "2023-05-13T02:05:45.845435Z",
|
||||
"shell.execute_reply": "2023-05-13T02:05:45.844361Z",
|
||||
"shell.execute_reply.started": "2023-05-13T02:05:45.816606Z"
|
||||
"iopub.execute_input": "2023-05-16T08:37:50.893472Z",
|
||||
"iopub.status.busy": "2023-05-16T08:37:50.892954Z",
|
||||
"iopub.status.idle": "2023-05-16T08:37:50.917547Z",
|
||||
"shell.execute_reply": "2023-05-16T08:37:50.916456Z",
|
||||
"shell.execute_reply.started": "2023-05-16T08:37:50.893441Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -339,7 +351,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'合成橡胶厂工会': 55, '热电厂工会': 104, '检验计量中心工会': 58, '合成树脂厂': 2, '炼油厂工会': 26, '有机化工厂工会': 1, '高科公司工会': 1, '储运厂工会': 1, '化学品厂工会': 3, '烯烃厂工会': 1}\n"
|
||||
"{'储运厂工会': 9, '热电厂工会': 65, '炼油厂工会': 48, '合成橡胶厂工会': 31, '检验计量中心工会': 34, '烯烃厂工会': 4, '化学品厂工会': 8, '合成树脂厂': 4, '生产运行保障中心': 1, '高科公司工会': 3, '有机化工厂工会': 3, '机关工会': 4}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -347,7 +359,7 @@
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"filename = 'data/result_燕山石化(20230512).json'\n",
|
||||
"filename = 'data/result_燕山石化(20230516).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"dict2 = {}\n",
|
||||
@@ -362,7 +374,7 @@
|
||||
" list2 = []\n",
|
||||
" list2 = [k,v]\n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/燕山石化部门测试人数情况表(20230512).xlsx'\n",
|
||||
"filename = 'data/燕山石化部门测试人数情况表(20230516).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -439,15 +451,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": 37,
|
||||
"id": "eddf7dab-b28d-402a-aeaf-27c120048ecb",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-14T14:17:34.734542Z",
|
||||
"iopub.status.busy": "2023-05-14T14:17:34.733685Z",
|
||||
"iopub.status.idle": "2023-05-14T14:17:34.966217Z",
|
||||
"shell.execute_reply": "2023-05-14T14:17:34.965520Z",
|
||||
"shell.execute_reply.started": "2023-05-14T14:17:34.734501Z"
|
||||
"iopub.execute_input": "2023-05-16T08:44:33.173111Z",
|
||||
"iopub.status.busy": "2023-05-16T08:44:33.172278Z",
|
||||
"iopub.status.idle": "2023-05-16T08:44:33.373625Z",
|
||||
"shell.execute_reply": "2023-05-16T08:44:33.372928Z",
|
||||
"shell.execute_reply.started": "2023-05-16T08:44:33.173071Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -458,12 +470,12 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"title = ['编号','姓名','性别','单位','车间','班组']\n",
|
||||
"filename = 'data/result_燕山石化-all.json'\n",
|
||||
"filename = 'data/result_燕山石化.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"# 筛选重名剔除名单\n",
|
||||
"chongming = []\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况(20230512).xlsx'\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况(20230515).xlsx'\n",
|
||||
"wb = openpyxl.load_workbook(filename)\n",
|
||||
"sheet = wb.active\n",
|
||||
"for n in range(1, sheet.max_row+1,2):\n",
|
||||
@@ -492,7 +504,7 @@
|
||||
" list2.append(dict2[k]['车间'])\n",
|
||||
" list2.append(dict2[k]['班组'])\n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/燕山石化未体测人员名单(截至20230512).xlsx'\n",
|
||||
"filename = 'data/燕山石化未体测人员名单(截至20230516).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -720,19 +732,31 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": 36,
|
||||
"id": "5df8eb8f-3594-40be-a491-b4d750bbd554",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-14T14:17:09.067724Z",
|
||||
"iopub.status.busy": "2023-05-14T14:17:09.067317Z",
|
||||
"iopub.status.idle": "2023-05-14T14:17:09.226025Z",
|
||||
"shell.execute_reply": "2023-05-14T14:17:09.225328Z",
|
||||
"shell.execute_reply.started": "2023-05-14T14:17:09.067697Z"
|
||||
"iopub.execute_input": "2023-05-16T08:44:02.431464Z",
|
||||
"iopub.status.busy": "2023-05-16T08:44:02.430604Z",
|
||||
"iopub.status.idle": "2023-05-16T08:44:02.587531Z",
|
||||
"shell.execute_reply": "2023-05-16T08:44:02.586608Z",
|
||||
"shell.execute_reply.started": "2023-05-16T08:44:02.431421Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "KeyError",
|
||||
"evalue": "'7160'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[0;32mIn[36], line 27\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m sheet\u001b[38;5;241m.\u001b[39mcell(n,\u001b[38;5;241m1\u001b[39m)\u001b[38;5;241m.\u001b[39mvalue \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 26\u001b[0m code \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(sheet\u001b[38;5;241m.\u001b[39mcell(n, \u001b[38;5;241m1\u001b[39m)\u001b[38;5;241m.\u001b[39mvalue)\n\u001b[0;32m---> 27\u001b[0m name \u001b[38;5;241m=\u001b[39m \u001b[43mdict1\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mcode\u001b[49m\u001b[43m)\u001b[49m\u001b[43m]\u001b[49m[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 28\u001b[0m unit \u001b[38;5;241m=\u001b[39m dict1[\u001b[38;5;28mstr\u001b[39m(code)][\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m工作单位\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 29\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mstr\u001b[39m(code) \u001b[38;5;129;01min\u001b[39;00m dict2\u001b[38;5;241m.\u001b[39mkeys():\n",
|
||||
"\u001b[0;31mKeyError\u001b[0m: '7160'"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -767,7 +791,7 @@
|
||||
" else:\n",
|
||||
" ce = '否'\n",
|
||||
" list3.append([code,name,unit,ce])\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况(20230512).xlsx'\n",
|
||||
"filename = 'data/燕山石化重名人员测试情况(20230516).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
|
||||
Reference in new issue
Block a user