This commit is contained in:
512song committed 2023-10-05 21:13:48 +08:00
1 parent c602f3853c
commit 19dc6ed276
5 files changed
+469 -94

No files matched your search

@@ -1 +1 @@
{"3532380": {"name": "鲁天笑", "sex": "男", "unit": "消防支队", "sub_unit": "党群(综合)科", "birth": "2001-02-15"}, "3532377": {"name": "白泽远", "sex": "男", "unit": "消防支队", "sub_unit": "党群(综合)科", "birth": "2001-08-24"}, "3532560": {"name": "张昊天", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2002-04-13"}, "3532569": {"name": "王冬", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-03-02"}, "3532539": {"name": "卢凯", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-10-16"}, "3532570": {"name": "孔佑琦", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2002-07-02"}, "3532501": {"name": "杨婉婷", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-01-03"}, "3532579": {"name": "田林燕", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-03-09"}, "3532542": {"name": "顾辰羽", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2000-06-07"}, "3532535": {"name": "贾炜昂", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1995-04-12"}, "3532583": {"name": "赵永杰", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-01-27"}, "3532578": {"name": "姚腾帅", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1999-12-26"}, "3532500": {"name": "杨鹏昊", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2002-01-31"}, "3532561": {"name": "赵娜", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-06-21"}, "3532549": {"name": "王维毅", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-04-02"}, "3532523": {"name": "刘梦凡", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-03-30"}, "3532552": {"name": "李祎炜", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1999-10-27"}, "3532525": {"name": "郝云倩", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1998-08-16"}, "3532581": {"name": "黄子豪", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2001-11-03"}, "3532512": {"name": "张士垚", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2002-12-06"}, "3532490": {"name": "王华清", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2001-08-18"}, "3532528": {"name": "武旭", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2001-12-24"}, "3532534": {"name": "王宇晨", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "1998-08-19"}, "3532530": {"name": "魏晨硕", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2003-03-28"}, "3532550": {"name": "刘欣", "sex": "女", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2002-03-28"}, "3532557": {"name": "徐铭远", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2001-05-03"}, "3532584": {"name": "许泽龙", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2000-06-24"}, "3532567": {"name": "黄丹", "sex": "女", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2001-08-20"}, "3532582": {"name": "刘洋", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2001-09-01"}, "3532572": {"name": "赵联杰", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业三区", "birth": "2001-10-17"}, "3532505": {"name": "龚向荣", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业三区", "birth": "2002-01-20"}, "3532548": {"name": "徐世昊", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2001-05-10"}, "3532532": {"name": "刘新贺", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2000-10-15"}, "3532554": {"name": "杨奥旭", "sex": "女", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2001-02-20"}, "3532551": {"name": "杨超壹", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2001-10-17"}, "3532565": {"name": "李瀚文", "sex": "男", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2002-02-09"}, "3532563": {"name": "温志伟", "sex": "男", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2002-02-14"}, "3532577": {"name": "徐圣尧", "sex": "男", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2001-09-24"}, "3532543": {"name": "张俊晴", "sex": "女", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2001-01-13"}, "3532544": {"name": "严梓沛", "sex": "女", "unit": "电仪部", "sub_unit"Line truncated {"3532380": {"name": "鲁天笑", "sex": "男", "unit": "消防支队", "sub_unit": "党群(综合)科", "birth": "2001-02-15"}, "3532377": {"name": "白泽远", "sex": "男", "unit": "消防支队", "sub_unit": "党群(综合)科", "birth": "2001-08-24"}, "3532560": {"name": "张昊天", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2002-04-13"}, "3532569": {"name": "王冬", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-03-02"}, "3532539": {"name": "卢凯", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-10-16"}, "3532570": {"name": "孔佑琦", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2002-07-02"}, "3532501": {"name": "杨婉婷", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-01-03"}, "3532579": {"name": "田林燕", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-03-09"}, "3532542": {"name": "顾辰羽", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2000-06-07"}, "3532535": {"name": "贾炜昂", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1995-04-12"}, "3532583": {"name": "赵永杰", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-01-27"}, "3532578": {"name": "姚腾帅", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1999-12-26"}, "3532500": {"name": "杨鹏昊", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2002-01-31"}, "3532561": {"name": "赵娜", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-06-21"}, "3532549": {"name": "王维毅", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-04-02"}, "3532523": {"name": "刘梦凡", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "2001-03-30"}, "3532552": {"name": "李祎炜", "sex": "男", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1999-10-27"}, "3532525": {"name": "郝云倩", "sex": "女", "unit": "电仪部", "sub_unit": "电仪南港分部", "birth": "1998-08-16"}, "3532581": {"name": "黄子豪", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2001-11-03"}, "3532512": {"name": "张士垚", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2002-12-06"}, "3532490": {"name": "王华清", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2001-08-18"}, "3532528": {"name": "武旭", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "2001-12-24"}, "3532534": {"name": "王宇晨", "sex": "男", "unit": "电仪部", "sub_unit": "控制系统运维室", "birth": "1998-08-19"}, "3532530": {"name": "魏晨硕", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2003-03-28"}, "3532550": {"name": "刘欣", "sex": "女", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2002-03-28"}, "3532557": {"name": "徐铭远", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2001-05-03"}, "3532584": {"name": "许泽龙", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2000-06-24"}, "3532567": {"name": "黄丹", "sex": "女", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2001-08-20"}, "3532582": {"name": "刘洋", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业四区", "birth": "2001-09-01"}, "3532572": {"name": "赵联杰", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业三区", "birth": "2001-10-17"}, "3532505": {"name": "龚向荣", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业三区", "birth": "2002-01-20"}, "3532548": {"name": "徐世昊", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2001-05-10"}, "3532532": {"name": "刘新贺", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2000-10-15"}, "3532554": {"name": "杨奥旭", "sex": "女", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2001-02-20"}, "3532551": {"name": "杨超壹", "sex": "男", "unit": "电仪部", "sub_unit": "电仪作业二区", "birth": "2001-10-17"}, "3532565": {"name": "李瀚文", "sex": "男", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2002-02-09"}, "3532563": {"name": "温志伟", "sex": "男", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2002-02-14"}, "3532577": {"name": "徐圣尧", "sex": "男", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2001-09-24"}, "3532543": {"name": "张俊晴", "sex": "女", "unit": "电仪部", "sub_unit": "仪表作业一区", "birth": "2001-01-13"}, "3532544": {"name": "严梓沛", "sex": "女", "unit": "电仪部", "sub_unit"Line truncated
+1
View File
@@ -494,6 +494,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"id": "59d38404-e097-4f08-a3fd-565e351f09bb", "id": "59d38404-e097-4f08-a3fd-565e351f09bb",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [], "tags": [],
"toc-hr-collapsed": true "toc-hr-collapsed": true
}, },
+37 -37
View File
@@ -1505,15 +1505,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 84, "execution_count": 91,
"id": "25283932-c03a-4a34-a59d-314fc64d8fbd", "id": "25283932-c03a-4a34-a59d-314fc64d8fbd",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-09-27T09:27:20.543608Z", "iopub.execute_input": "2023-09-28T08:14:54.967853Z",
"iopub.status.busy": "2023-09-27T09:27:20.543145Z", "iopub.status.busy": "2023-09-28T08:14:54.967348Z",
"iopub.status.idle": "2023-09-27T09:27:21.242939Z", "iopub.status.idle": "2023-09-28T08:14:55.646142Z",
"shell.execute_reply": "2023-09-27T09:27:21.242479Z", "shell.execute_reply": "2023-09-28T08:14:55.645690Z",
"shell.execute_reply.started": "2023-09-27T09:27:20.543572Z" "shell.execute_reply.started": "2023-09-28T08:14:54.967794Z"
}, },
"tags": [] "tags": []
}, },
@@ -1600,15 +1600,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 85, "execution_count": 93,
"id": "e26b88fc-c75b-4c1e-82ea-5017370afa9b", "id": "e26b88fc-c75b-4c1e-82ea-5017370afa9b",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-09-27T09:27:32.161757Z", "iopub.execute_input": "2023-09-28T08:15:07.879075Z",
"iopub.status.busy": "2023-09-27T09:27:32.161547Z", "iopub.status.busy": "2023-09-28T08:15:07.878681Z",
"iopub.status.idle": "2023-09-27T09:27:32.294821Z", "iopub.status.idle": "2023-09-28T08:15:08.111382Z",
"shell.execute_reply": "2023-09-27T09:27:32.294362Z", "shell.execute_reply": "2023-09-28T08:15:08.110857Z",
"shell.execute_reply.started": "2023-09-27T09:27:32.161743Z" "shell.execute_reply.started": "2023-09-28T08:15:07.879044Z"
}, },
"tags": [] "tags": []
}, },
@@ -1617,8 +1617,8 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"2542\n", "2816\n",
"2542\n" "2816\n"
] ]
} }
], ],
@@ -1641,7 +1641,7 @@
"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/places_result_20230927.csv'\n", "filename = 'data/places_result_20230928.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n", "with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n", " fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n", " header = next(fl) \n",
@@ -1680,15 +1680,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 86, "execution_count": 94,
"id": "0a6ea33d-c112-4ed8-9366-3376e55a5731", "id": "0a6ea33d-c112-4ed8-9366-3376e55a5731",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-09-27T09:28:05.780297Z", "iopub.execute_input": "2023-09-28T08:15:20.956628Z",
"iopub.status.busy": "2023-09-27T09:28:05.779887Z", "iopub.status.busy": "2023-09-28T08:15:20.956374Z",
"iopub.status.idle": "2023-09-27T09:28:06.469706Z", "iopub.status.idle": "2023-09-28T08:15:21.702196Z",
"shell.execute_reply": "2023-09-27T09:28:06.469235Z", "shell.execute_reply": "2023-09-28T08:15:21.701702Z",
"shell.execute_reply.started": "2023-09-27T09:28:05.780266Z" "shell.execute_reply.started": "2023-09-28T08:15:20.956609Z"
}, },
"tags": [] "tags": []
}, },
@@ -1724,7 +1724,7 @@
" else:\n", " else:\n",
" list2.append('') \n", " list2.append('') \n",
" list1.append(list2)\n", " list1.append(list2)\n",
"filename = 'data/天津石化体测情况(截至20230927).xlsx'\n", "filename = 'data/天津石化体测情况(截至20230928).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",
@@ -1744,15 +1744,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 87, "execution_count": 95,
"id": "589a5d44-605d-41a1-a981-7ec7258305ed", "id": "589a5d44-605d-41a1-a981-7ec7258305ed",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-09-27T09:28:15.981879Z", "iopub.execute_input": "2023-09-28T08:16:59.146067Z",
"iopub.status.busy": "2023-09-27T09:28:15.981612Z", "iopub.status.busy": "2023-09-28T08:16:59.145853Z",
"iopub.status.idle": "2023-09-27T09:28:16.042203Z", "iopub.status.idle": "2023-09-28T08:16:59.182933Z",
"shell.execute_reply": "2023-09-27T09:28:16.040772Z", "shell.execute_reply": "2023-09-28T08:16:59.182479Z",
"shell.execute_reply.started": "2023-09-27T09:28:15.981860Z" "shell.execute_reply.started": "2023-09-28T08:16:59.146053Z"
}, },
"tags": [] "tags": []
}, },
@@ -1789,7 +1789,7 @@
" list2 = [k,v['人数']]\n", " list2 = [k,v['人数']]\n",
" list1.append(list2)\n", " list1.append(list2)\n",
"\n", "\n",
"filename = 'data/天津部门未测试情况(截至20230927).xlsx'\n", "filename = 'data/天津部门未测试情况(截至20230928).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",
@@ -1809,15 +1809,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 90, "execution_count": 98,
"id": "2f7c9847-f283-4a09-b385-2c7559be7c7e", "id": "2f7c9847-f283-4a09-b385-2c7559be7c7e",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-09-27T09:32:32.610462Z", "iopub.execute_input": "2023-09-28T08:18:55.583592Z",
"iopub.status.busy": "2023-09-27T09:32:32.610068Z", "iopub.status.busy": "2023-09-28T08:18:55.583111Z",
"iopub.status.idle": "2023-09-27T09:32:32.652697Z", "iopub.status.idle": "2023-09-28T08:18:55.648596Z",
"shell.execute_reply": "2023-09-27T09:32:32.652219Z", "shell.execute_reply": "2023-09-28T08:18:55.647144Z",
"shell.execute_reply.started": "2023-09-27T09:32:32.610432Z" "shell.execute_reply.started": "2023-09-28T08:18:55.583543Z"
}, },
"tags": [] "tags": []
}, },
@@ -1833,8 +1833,8 @@
"filename = 'data/天津石化人员名单2023.json'\n", "filename = 'data/天津石化人员名单2023.json'\n",
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n", " dict2 = json.load(fl)\n",
"unit_name = '化工部'\n", "unit_name = '烯烃部'\n",
"rq = '20230927'\n", "rq = '20230928'\n",
"list1 = []\n", "list1 = []\n",
"\n", "\n",
"i = 1\n", "i = 1\n",
+430 -56
View File
@@ -4,7 +4,6 @@
"cell_type": "markdown", "cell_type": "markdown",
"id": "55644860-57e6-466b-b6e9-e6fdd807498d", "id": "55644860-57e6-466b-b6e9-e6fdd807498d",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [] "tags": []
}, },
"source": [ "source": [
@@ -859,7 +858,9 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "6ba73ead-6715-46a6-b4a9-3a00b733b151", "id": "6ba73ead-6715-46a6-b4a9-3a00b733b151",
"metadata": {}, "metadata": {
"tags": []
},
"source": [ "source": [
"## 导入学生信息" "## 导入学生信息"
] ]
@@ -913,28 +914,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": null,
"id": "3f1b2284-c39e-4dc2-bc0c-983fb8e3417f", "id": "3f1b2284-c39e-4dc2-bc0c-983fb8e3417f",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-09-16T11:56:29.189193Z",
"iopub.status.busy": "2023-09-16T11:56:29.188795Z",
"iopub.status.idle": "2023-09-16T11:56:29.210384Z",
"shell.execute_reply": "2023-09-16T11:56:29.209858Z",
"shell.execute_reply.started": "2023-09-16T11:56:29.189160Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"508\n",
"508\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import time\n", "import time\n",
@@ -1047,37 +1032,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": null,
"id": "6f4341d7-b836-4186-a4c6-370e9e207e0a", "id": "6f4341d7-b836-4186-a4c6-370e9e207e0a",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-09-16T11:56:38.115567Z",
"iopub.status.busy": "2023-09-16T11:56:38.115110Z",
"iopub.status.idle": "2023-09-16T11:56:38.239480Z",
"shell.execute_reply": "2023-09-16T11:56:38.239046Z",
"shell.execute_reply.started": "2023-09-16T11:56:38.115531Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"8076\n",
"8113\n",
"8137\n",
"8228\n",
"8239\n",
"8283\n",
"8299\n",
"8416\n",
"8488\n",
"8504\n",
"ok\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import openpyxl\n", "import openpyxl\n",
@@ -1128,16 +1088,9 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": null,
"id": "04e27e02-7a69-42a8-a21a-61151a8a1427", "id": "04e27e02-7a69-42a8-a21a-61151a8a1427",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-09-16T11:58:41.367300Z",
"iopub.status.busy": "2023-09-16T11:58:41.366840Z",
"iopub.status.idle": "2023-09-16T11:58:41.486698Z",
"shell.execute_reply": "2023-09-16T11:58:41.486218Z",
"shell.execute_reply.started": "2023-09-16T11:58:41.367264Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -1171,10 +1124,431 @@
"wb.save(filename)" "wb.save(filename)"
] ]
}, },
{
"cell_type": "markdown",
"id": "6cd42cb2-37a4-44e8-87cb-afd71b32e81f",
"metadata": {},
"source": [
"# 教师体测"
]
},
{
"cell_type": "markdown",
"id": "4ba29d0e-0af3-4c59-92cf-5c697ae20d16",
"metadata": {},
"source": [
"## 导入教师信息"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "bc2b121a-948f-481a-b777-5879883d3c10", "id": "93cc6471-36b5-43ce-9128-1c06768b0d01",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"\n",
"wb = openpyxl.load_workbook('data/教职工监测花名册.xlsx')\n",
"sheet = wb.active\n",
"# sheets = wb.sheetnames\n",
"person = {}\n",
"\n",
"for n in range(2, sheet.max_row+1):\n",
" if sheet.cell(n,1).value is not None:\n",
" code = int(sheet.cell(n, 4).value)\n",
" person.setdefault(code, {})\n",
" dict1 = {}\n",
" dict1['name'] = sheet.cell(n, 6).value\n",
" if int(sheet.cell(n, 7).value) ==1:\n",
" sex = '男'\n",
" else:\n",
" sex = '女'\n",
" dict1['sex'] = sex\n",
" birth = str(sheet.cell(n, 8).value).split()[0]\n",
" dict1['birth'] = birth\n",
" dict1['unit'] = sheet.cell(n, 3).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('ok')"
]
},
{
"cell_type": "markdown",
"id": "d2b61b63-2923-4fc9-ab0c-9ec8453760f2",
"metadata": {},
"source": [
"## 每日成绩导入"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "41ed428a-30bc-4150-bf74-e25228e1ca67",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" item[k] = v\n",
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/长岭教师名单.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20231005.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",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\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",
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
" re_ta[user]['unit'] = dict1[user]['unit']\n",
" re_ta[user]['birth'] = dict1[user]['birth']\n",
" item_name = item[m_item]['name']\n",
" re_ta[user].setdefault(item_name,{}) \n",
" 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_长岭教师.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
"print(len(re_ta))\n"
]
},
{
"cell_type": "markdown",
"id": "839bd6f9-f262-4640-99ea-2391caf63830",
"metadata": {},
"source": [
"## 计算人员年龄"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5e49f274-09d9-4eb6-ad4a-b70d217b6aa0",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import datetime\n",
"\n",
"filename = 'data/result_长岭教师.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"for k, v in dict1.items():\n",
" #print(k,v)\n",
" if '.' in v['birth']:\n",
" birth = v['birth'].split()[0].split('.')\n",
" else:\n",
" birth = v['birth'].split()[0].split('/')\n",
" \n",
" nian = int(birth[0].strip())\n",
" yue = int(birth[1].strip())\n",
" ri = int(birth[2].strip())\n",
" #print(k,nian,yue,ri)\n",
" days = (datetime.date(2023, 9, 11)-datetime.date(nian,yue,ri)).days\n",
" v['age'] = int(days/365)\n",
"filename = 'data/result_长岭教师.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl, ensure_ascii=False) \n",
"print('ok') "
]
},
{
"cell_type": "markdown",
"id": "8d0834c0-0cb7-4172-b01f-3ef8227e3d72",
"metadata": {},
"source": [
"## 计算测试得分"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "67fbefc0-a899-460d-a8c9-7d0633a33d7a",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import time\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict3 = json.load(fl) \n",
"for k,v in dict3.items():\n",
" item[k] = v\n",
"item['1']['en'] = 'lung'\n",
"item['2']['en'] = 'grip'\n",
"item['3']['en'] = 'flexion'\n",
"item['4']['en'] = 'jump'\n",
"item['5']['en'] = 'pushup'\n",
"item['6']['en'] = 'balance'\n",
"item['7']['en'] = 'reaction'\n",
"item['8']['en'] = 'step'\n",
"item['9']['en'] = 'situp'\n",
"item['10']['en'] = 'height'\n",
"item['11']['en'] = 'weight'\n",
"\n",
"filename = 'data/体质检测标准 (1).json' \n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"\n",
"\n",
"def cal_score(data1):\n",
" #data = {'name':'张三','sex':'M','age':37,'item':'StepExperiment','result':46} \n",
" person = dict1['person']\n",
" criteria = dict1['criteria'] \n",
" info = data1['sex']+str(data1['age'])\n",
" bz = person[info]\n",
" mx = criteria[bz][data1['item']]\n",
" result = data1['result'] \n",
" if data1['item'] == 'reaction':\n",
" for bz1 in mx:\n",
" if result > bz1:\n",
" #print(bz1)\n",
" score = mx.index(bz1,0)\n",
" break\n",
" else:\n",
" score = 5\n",
" else:\n",
" for bz1 in mx:\n",
" if result < bz1:\n",
" #print(bz1)\n",
" score = mx.index(bz1,0)\n",
" break\n",
" else:\n",
" score = 5\n",
" return(score)\n",
"filename = 'data/体质检测标准_BMI.json'\n",
"with open(filename,'r') as fl:\n",
" dict4 = json.load(fl) \n",
" \n",
"def cal_bmi(data1):\n",
" # data = {'name':'张三','sex':'M','age':37,'item':'HeightWeight','result':'177.7,97.0'}\n",
" person = dict4['person']\n",
" criteria = dict4['criteria']\n",
" \n",
" info = data1['sex']+str(data1['age'])\n",
" bz = person[info]\n",
" #print(bz)\n",
" result = data1['result']\n",
" print(result)\n",
" height = int(float(result.split(',')[0]))\n",
" weight = float(result.split(',')[1])\n",
" mx = criteria[bz][str(height)]\n",
" if weight < mx[0]:\n",
" score = 1\n",
" elif weight < mx[1]:\n",
" score = 3\n",
" elif weight < mx[2]:\n",
" score = 5 \n",
" elif weight <= mx[3]:\n",
" score = 3 \n",
" elif weight > mx[3]:\n",
" score = 1\n",
" return score\n",
" \n",
" \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",
" if v['sex'] == '男':\n",
" sex = 'M'\n",
" else:\n",
" sex = 'F' \n",
" if 'height' in v.keys() and 'weight' in v.keys():\n",
" bmi_data = v['height']['成绩'].split()[0]+','+ v['weight']['成绩'].split()[0]\n",
" data1 = {'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'] = cal_bmi(data1)\n",
" for item_en in list_item:\n",
" if item_en in v.keys(): \n",
" data1 = {'sex':sex,'age':v['age'],'item':item_en,'result':float(v[item_en]['成绩'].split()[0])}\n",
" dict2[k][item_en]['score'] = 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": "code",
"execution_count": null,
"id": "fc43f558-a22d-4872-bca1-f87066ab4fe4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "a26bb4e2-106f-4e72-b102-7141fdf23f85",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"\n",
"\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
"filename = 'data/result_长岭教师.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" print(k)\n",
" score = 0\n",
" i = 0 \n",
" for k1,v1 in v.items(): \n",
" if k1 in list_item:\n",
" score = score + int(v1['score'])\n",
" i+=1\n",
" dict1[k]['score'] = round(score/i,2) \n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl, ensure_ascii=False) \n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "970ac26e-6db4-4457-aa85-d672373c9479",
"metadata": {},
"source": [
"## 计算平均成绩"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "861a91f2-6256-4713-8028-6d6aae3b917d",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"\n",
"filename = f'data/result_长岭教师.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"i = 1\n",
"m = 0\n",
"f = 0\n",
"score = 0\n",
"t_score = 0\n",
"for k,v in dict1.items():\n",
" if v['sex'] == '男':\n",
" m = m +1\n",
" score = score+v['score']\n",
"print(f'平均成绩:{round(score/m,4)}分,男性:{m}人')\n",
"t_score = t_score + score\n",
"score = 0\n",
"for k,v in dict1.items():\n",
" if v['sex'] == '女':\n",
" f = f +1\n",
" score = score+v['score']\n",
"print(f'平均成绩:{round(score/f,4)}分,女性:{f}人')\n",
"t_score = t_score + score\n",
"print(f'平均成绩:{round(t_score/38,4)}分,总体:38人')"
]
},
{
"cell_type": "markdown",
"id": "db9ba2e8-a7b0-472f-84c2-84872643a385",
"metadata": {},
"source": [
"## 计算各项目平均成绩"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5f112c32-5402-4fe9-b737-2c9c65ba0d49",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"\n",
"filename = f'data/result_长岭教师.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"i = 1\n",
"m = 0\n",
"f = 0\n",
"score = 0\n",
"t_score = 0\n",
"list_item = ['lung','flexion','reaction','bmi']\n",
"for item in list_item:\n",
" m = 0\n",
" f = 0\n",
" score = 0\n",
" t_score = 0\n",
" for k,v in dict1.items():\n",
" if v['sex'] == '男' and item in v.keys():\n",
" m = m +1\n",
" score = score+v['score']\n",
" print(f'{item}平均成绩:{round(score/m,4)}分,男性:{m}人')\n",
" t_score = t_score + score\n",
" score = 0\n",
" for k,v in dict1.items():\n",
" if v['sex'] == '女' and item in v.keys():\n",
" f = f +1\n",
" score = score+v['score']\n",
" print(f'{item}平均成绩:{round(score/f,4)}分,女性:{f}人')\n",
" t_score = t_score + score\n",
" print(f'{item}平均成绩:{round(t_score/(f+m),4)}分,总体:{f+m}人')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bb9c6bf3-8f84-4290-a60c-710517a399d5",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [] "source": []