This commit is contained in:
512song committed 2023-04-23 14:56:30 +00:00
1 parent 64403d556b
commit db04db8a17
1 file changed
+54 -37
+54 -37
View File
@@ -10,15 +10,15 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 100,
"id": "1b92b7c5-cb77-49da-95b7-34827ecf1d16",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-17T12:35:15.468795Z",
"iopub.status.busy": "2023-04-17T12:35:15.467942Z",
"iopub.status.idle": "2023-04-17T12:35:17.788780Z",
"shell.execute_reply": "2023-04-17T12:35:17.787971Z",
"shell.execute_reply.started": "2023-04-17T12:35:15.468765Z"
"iopub.execute_input": "2023-04-23T14:28:28.286159Z",
"iopub.status.busy": "2023-04-23T14:28:28.285377Z",
"iopub.status.idle": "2023-04-23T14:28:30.884454Z",
"shell.execute_reply": "2023-04-23T14:28:30.883613Z",
"shell.execute_reply.started": "2023-04-23T14:28:28.286119Z"
},
"tags": []
},
@@ -85,15 +85,15 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 103,
"id": "71e1ec6a-6797-4496-969a-1d1461b9ea58",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-17T12:58:30.871865Z",
"iopub.status.busy": "2023-04-17T12:58:30.870992Z",
"iopub.status.idle": "2023-04-17T12:58:30.978471Z",
"shell.execute_reply": "2023-04-17T12:58:30.977610Z",
"shell.execute_reply.started": "2023-04-17T12:58:30.871824Z"
"iopub.execute_input": "2023-04-23T14:40:40.245318Z",
"iopub.status.busy": "2023-04-23T14:40:40.244479Z",
"iopub.status.idle": "2023-04-23T14:40:40.427554Z",
"shell.execute_reply": "2023-04-23T14:40:40.426732Z",
"shell.execute_reply.started": "2023-04-23T14:40:40.245276Z"
},
"tags": []
},
@@ -102,8 +102,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"343\n",
"ok\n"
"427\n",
"4207 王新刚 已测试!\n",
"427\n",
"2223\n"
]
}
],
@@ -126,7 +128,7 @@
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20230417.csv'\n",
"filename = 'data/places_result_20230423.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -136,8 +138,7 @@
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\n",
" if user in dict1.keys():\n",
" \n",
" if user in dict1.keys(): \n",
" m_item = str(result[3]) \n",
" re_ta.setdefault(user,{}) \n",
" re_ta[user]['name'] = dict1[user]['name']\n",
@@ -148,10 +149,26 @@
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
"print(len(re_ta))\n",
"filename = 'data/result_燕山石化(20230417).json'\n",
"filename = 'data/result_燕山石化.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
"for k in re_ta.keys():\n",
" if k in dict2.keys():\n",
" print(k,dict2[k]['name'],'已测试!')\n",
"for k, v in re_ta.items():\n",
" if k not in dict2.keys():\n",
" dict2[k] = v\n",
" else:\n",
" for k1,v1 in v.items():\n",
" dict2[k][k1] = v1\n",
"filename = 'data/result_燕山石化(20230423).json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl) \n",
"print('ok')"
" json.dump(re_ta, fl, ensure_ascii=False) \n",
"print(len(re_ta))\n",
"filename = 'data/result_燕山石化.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict2, fl, ensure_ascii=False) \n",
"print(len(dict2))"
]
},
{
@@ -164,15 +181,15 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 104,
"id": "c24880ad-bbbd-4ad8-a894-cbcea389e822",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-17T12:58:35.966367Z",
"iopub.status.busy": "2023-04-17T12:58:35.965948Z",
"iopub.status.idle": "2023-04-17T12:58:36.125657Z",
"shell.execute_reply": "2023-04-17T12:58:36.124946Z",
"shell.execute_reply.started": "2023-04-17T12:58:35.966339Z"
"iopub.execute_input": "2023-04-23T14:42:25.680289Z",
"iopub.status.busy": "2023-04-23T14:42:25.679890Z",
"iopub.status.idle": "2023-04-23T14:42:25.850582Z",
"shell.execute_reply": "2023-04-23T14:42:25.849877Z",
"shell.execute_reply.started": "2023-04-23T14:42:25.680261Z"
},
"tags": []
},
@@ -183,7 +200,7 @@
"\n",
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"title = ['编号','姓名','性别','单位','车间','班组','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"filename = 'data/result_燕山石化(20230417).json'\n",
"filename = 'data/result_燕山石化(20230423).json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
@@ -208,7 +225,7 @@
" else:\n",
" list2.append('') \n",
" list1.append(list2)\n",
"filename = 'data/燕山石化体测情况表(20230417).xlsx'\n",
"filename = 'data/燕山石化体测情况表(20230423).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
@@ -228,15 +245,15 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 105,
"id": "68454877-f1fe-4eed-8a48-265e428f892e",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-17T12:58:42.418562Z",
"iopub.status.busy": "2023-04-17T12:58:42.418127Z",
"iopub.status.idle": "2023-04-17T12:58:42.446368Z",
"shell.execute_reply": "2023-04-17T12:58:42.445328Z",
"shell.execute_reply.started": "2023-04-17T12:58:42.418533Z"
"iopub.execute_input": "2023-04-23T14:48:24.388302Z",
"iopub.status.busy": "2023-04-23T14:48:24.387468Z",
"iopub.status.idle": "2023-04-23T14:48:24.424034Z",
"shell.execute_reply": "2023-04-23T14:48:24.422941Z",
"shell.execute_reply.started": "2023-04-23T14:48:24.388269Z"
},
"tags": []
},
@@ -245,7 +262,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{'行政事务中心(离退中心)工会': 83, '机关工会': 80, '消防中心工会': 44, '生产运行保障中心': 85, '教育培训中心工会': 19, '烯烃厂工会': 2, '物装中心工会': 29, '有机化工厂工会': 1}\n"
"{'行政事务中心(离退中心)工会': 7, '检验计量中心工会': 140, '炼油厂工会': 35, '合成橡胶厂工会': 138, '有机化工厂工会': 10, '热电厂工会': 63, '消防中心工会': 2, '化学品厂工会': 6, '机关工会': 10, '烯烃厂工会': 8, '生产运行保障中心': 6, '物装中心工会': 1, '储运厂工会': 1}\n"
]
}
],
@@ -253,7 +270,7 @@
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/result_燕山石化(20230417).json'\n",
"filename = 'data/result_燕山石化(20230423).json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"dict2 = {}\n",
@@ -268,7 +285,7 @@
" list2 = []\n",
" list2 = [k,v]\n",
" list1.append(list2)\n",
"filename = 'data/燕山石化部门测试人数情况表(20230417).xlsx'\n",
"filename = 'data/燕山石化部门测试人数情况表(20230423).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",