This commit is contained in:
512song committed 2024-09-29 10:22:23 +08:00
1 parent 3a9cb48f1e
commit c03192efe5
4 files changed
+295 -113

No files matched your search

+159 -2
View File
@@ -1,5 +1,13 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "b6ce4321-f82a-4d9d-a110-44a23b95970b",
"metadata": {},
"source": [
"# 2023年体质检测"
]
},
{
"cell_type": "markdown",
"id": "28695364-38de-442e-818d-cfab45902763",
@@ -840,10 +848,159 @@
"print(data)"
]
},
{
"cell_type": "markdown",
"id": "d3649684-3eab-49ad-8b3d-ebb452289e51",
"metadata": {},
"source": [
"# 2024年体质检测"
]
},
{
"cell_type": "markdown",
"id": "a3f5f78e-6785-48e6-b2b6-b91b8d2aa4ca",
"metadata": {},
"source": [
"## 导入人员信息"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "096e2b97-b83c-46bb-a070-c816e47da331",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-26T08:13:44.536115Z",
"iopub.status.busy": "2024-09-26T08:13:44.535333Z",
"iopub.status.idle": "2024-09-26T08:13:44.828454Z",
"shell.execute_reply": "2024-09-26T08:13:44.827938Z",
"shell.execute_reply.started": "2024-09-26T08:13:44.536043Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"\n",
"wb = openpyxl.load_workbook('data/东营石油工程设计公司(2024).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, 1).value)\n",
" person.setdefault(code, {})\n",
" dict1 = {}\n",
" dict1['name'] = sheet.cell(n, 3).value\n",
" dict1['sex'] = sheet.cell(n, 4).value\n",
" dict1['unit'] = sheet.cell(n, 2).value\n",
" if sheet.cell(n, 5).value is not None:\n",
" dict1['gh'] = sheet.cell(n, 7).value\n",
" #dict1['birth'] = str(sheet.cell(n, 6).value).replace('/','-').split(' ')[0] \n",
" if sheet.cell(n, 4).value is not None:\n",
" dict1['phone'] = str(sheet.cell(n,6).value)\n",
"\n",
"\n",
" person[code] = dict1\n",
"filename = 'data/东营工程设计院2024.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(person, fl, ensure_ascii=False)\n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "926e4dc3-fe7a-4b8b-9330-5a9eebc8a766",
"metadata": {},
"source": [
"## 获取人员测试成绩(新格式)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "28afeee6-43c0-4e96-b3aa-dc09c6288425",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-26T08:18:32.261817Z",
"iopub.status.busy": "2024-09-26T08:18:32.261244Z",
"iopub.status.idle": "2024-09-26T08:18:32.276332Z",
"shell.execute_reply": "2024-09-26T08:18:32.275838Z",
"shell.execute_reply.started": "2024-09-26T08:18:32.261764Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"75\n",
"75\n"
]
}
],
"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/东营工程设计院2024.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20240926.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]['sub_unit'] = dict1[user]['sub_unit']\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_东营工程设计院2024.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
"print(len(re_ta))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c5ef31b6-ceed-4167-bec7-58e92b3698e1",
"id": "cef2ced9-2cd1-4632-8fe6-6a5a57e2fcb3",
"metadata": {},
"outputs": [],
"source": []
@@ -865,7 +1022,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.3"
}
},
"nbformat": 4,
+7 -7
View File
@@ -1115,15 +1115,15 @@
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": 101,
"id": "cccc2e43-7a73-48ec-8540-06b4d59f8ceb",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-22T11:06:13.897106Z",
"iopub.status.busy": "2024-09-22T11:06:13.896366Z",
"iopub.status.idle": "2024-09-22T11:06:13.985127Z",
"shell.execute_reply": "2024-09-22T11:06:13.984566Z",
"shell.execute_reply.started": "2024-09-22T11:06:13.897035Z"
"iopub.execute_input": "2024-09-25T07:48:05.301620Z",
"iopub.status.busy": "2024-09-25T07:48:05.301088Z",
"iopub.status.idle": "2024-09-25T07:48:05.386752Z",
"shell.execute_reply": "2024-09-25T07:48:05.386215Z",
"shell.execute_reply.started": "2024-09-25T07:48:05.301569Z"
}
},
"outputs": [
@@ -1141,7 +1141,7 @@
"\n",
"\n",
"filename = 'data/result_镇海2.json'\n",
"with open(filename,'r') as fl:\n",
"with open(filename,'r',encoding = 'utf-8') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
" \n",
+32 -7
View File
@@ -2367,10 +2367,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "1e2d586e-6ff5-4fd1-a909-278d23e54561",
"metadata": {},
"outputs": [],
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-29T02:18:02.228980Z",
"iopub.status.busy": "2024-09-29T02:18:02.228201Z",
"iopub.status.idle": "2024-09-29T02:18:02.253056Z",
"shell.execute_reply": "2024-09-29T02:18:02.252599Z",
"shell.execute_reply.started": "2024-09-29T02:18:02.228910Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"80\n",
"80\n"
]
}
],
"source": [
"import json\n",
"import time\n",
@@ -2390,7 +2407,7 @@
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20240705.csv'\n",
"filename = 'data/places_result_20240929.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -2428,9 +2445,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "64c6e1e3-801c-4573-b78f-5a9e842597a9",
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-29T02:18:45.748557Z",
"iopub.status.busy": "2024-09-29T02:18:45.748059Z",
"iopub.status.idle": "2024-09-29T02:18:45.957948Z",
"shell.execute_reply": "2024-09-29T02:18:45.957465Z",
"shell.execute_reply.started": "2024-09-29T02:18:45.748511Z"
}
},
"outputs": [],
"source": [
"import json\n",
@@ -2463,7 +2488,7 @@
" else:\n",
" list2.append('') \n",
" list1.append(list2)\n",
"filename = 'data/湖南石化青年体质检测.xlsx'\n",
"filename = 'data/湖南石化青年体质检测情况表(20240720).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
+97 -97
View File
@@ -21,28 +21,28 @@
"id": "c9be219d-2638-4115-91b8-124b5e40826f",
"metadata": {},
"source": [
"弈理析疑全局目录\n",
"对子十五局 受子局五局\n",
"周东侯 黄龙士\n",
"徐星友 程兰如\n",
"梁魏今 程兰如\n",
"梁魏今 施襄夏\n",
"范西屏 施襄夏\n",
"范西屏 李步青\n",
"黄龙士 徐星友\n",
"周东侯 黄龙士\n",
"程兰如 徐星友\n",
"程兰如 梁魏今\n",
"范西屏 施襄夏\n",
"施襄夏 梁魏今\n",
"黄龙士 徐星友\n",
"范西屏 黄友功\n",
"程仲容 黄龙士\n",
"程兰如 梁魏今\n",
"冒湘舟 程兰如\n",
"施襄夏 范西屏\n",
"臧念宣 范西屏\n",
"黄龙士 徐星友\n"
"弈理析疑全局目录 \n",
"对子十五局 受子局五局 \n",
"周东侯 黄龙士 \n",
"徐星友 程兰如 \n",
"梁魏今 程兰如 \n",
"梁魏今 施襄夏 \n",
"范西屏 施襄夏 \n",
"范西屏 李步青 \n",
"黄龙士 徐星友 \n",
"周东侯 黄龙士 \n",
"程兰如 徐星友 \n",
"程兰如 梁魏今 \n",
"范西屏 施襄夏 \n",
"施襄夏 梁魏今 \n",
"黄龙士 徐星友 \n",
"范西屏 黄友功 \n",
"程仲容 黄龙士 \n",
"程兰如 梁魏今 \n",
"冒湘舟 程兰如 \n",
"施襄夏 范西屏 \n",
"臧念宣 范西屏 \n",
"黄龙士 徐星友 \n"
]
},
{
@@ -58,10 +58,10 @@
"id": "933093e8-441c-4d31-a11c-c160d22dcadc",
"metadata": {},
"source": [
"白:周东侯\n",
"黑:黄龙士\n",
"共288着\n",
"和棋"
"白:周东侯 \n",
"黑:黄龙士 \n",
"共288着 \n",
"和棋 "
]
},
{
@@ -124,10 +124,10 @@
"id": "00230b6f-7926-48cb-80e2-cb5f27569369",
"metadata": {},
"source": [
"白:周东侯\n",
"黑:黄龙士\n",
"共290着\n",
"黑胜"
"白:周东侯 \n",
"黑:黄龙士 \n",
"共290着 \n",
"黑胜 "
]
},
{
@@ -191,10 +191,10 @@
"id": "6d01fc73-0c18-4021-9407-975dc63c2f7e",
"metadata": {},
"source": [
"白:程仲容\n",
"黑:黄龙士\n",
"共171着\n",
"白胜"
"白:程仲容 \n",
"黑:黄龙士 \n",
"共171着 \n",
"白胜 "
]
},
{
@@ -246,10 +246,10 @@
"id": "c6e45140-57cf-47a7-8576-1f2648e1d87d",
"metadata": {},
"source": [
"白:徐星友\n",
"黑:程兰如\n",
"共237着\n",
"黑胜\n",
"白:徐星友 \n",
"黑:程兰如 \n",
"共237着 \n",
"黑胜 \n",
"注:本局为《寄青霞馆弈选》卷四•十七,棋谱首有:此局弈理析疑误刻徐先程后,故修圃有星友始终不肯大飞云云,当依臧本改正作程先徐后。\n",
"主者因兰如屡胜,此局阴令众国工不必合谋,看二人对垒如何。而兰如遂负。自此以后,仍令中算胜徐,而徐亦因此旋里矣。右録鸿雪轩原评。"
]
@@ -308,10 +308,10 @@
"id": "85892f84-6d24-44fc-a036-3273d93d0c54",
"metadata": {},
"source": [
"白:程兰如\n",
"黑:徐星友\n",
"共236着\n",
"白胜"
"白:程兰如 \n",
"黑:徐星友 \n",
"共236着 \n",
"白胜 "
]
},
{
@@ -370,10 +370,10 @@
"id": "836381f9-e4d6-46f7-b39a-0a0b9d6d1cb8",
"metadata": {},
"source": [
"白:程兰如\n",
"黑:梁魏今\n",
"共236着\n",
"白胜"
"白:程兰如 \n",
"黑:梁魏今 \n",
"共236着 \n",
"白胜 "
]
},
{
@@ -442,10 +442,10 @@
"id": "59ab6de1-2624-4027-8705-2d82b92b3609",
"metadata": {},
"source": [
"白:梁魏今\n",
"黑:程兰如\n",
"共196着\n",
"白胜"
"白:梁魏今 \n",
"黑:程兰如 \n",
"共196着 \n",
"白胜 "
]
},
{
@@ -556,10 +556,10 @@
"id": "c939259a-5de8-4691-a313-5e31e28d2590",
"metadata": {},
"source": [
"白:冒湘舟\n",
"黑:程兰如\n",
"共214着\n",
"黑胜"
"白:冒湘舟 \n",
"黑:程兰如 \n",
"共214着 \n",
"黑胜 "
]
},
{
@@ -607,10 +607,10 @@
"id": "473ace8b-53cf-4640-ac8e-30cdb9cc276e",
"metadata": {},
"source": [
"白:梁魏今\n",
"黑:施襄夏\n",
"共262着\n",
"黑胜"
"白:梁魏今 \n",
"黑:施襄夏 \n",
"共262着 \n",
"黑胜 "
]
},
{
@@ -672,9 +672,9 @@
"id": "fe94e413-a678-450a-887f-b1f473166094",
"metadata": {},
"source": [
"白:梁魏今\n",
"黑:施襄夏\n",
"共260着"
"白:梁魏今 \n",
"黑:施襄夏 \n",
"共260着 "
]
},
{
@@ -738,10 +738,10 @@
"id": "ab64c867-6007-4cb7-9dc4-833e63b8b903",
"metadata": {},
"source": [
"白:施襄夏\n",
"黑:范西屏\n",
"共270着\n",
"白胜"
"白:施襄夏 \n",
"黑:范西屏 \n",
"共270着 \n",
"白胜 "
]
},
{
@@ -787,10 +787,10 @@
"id": "6efcffbb-69bc-4573-8538-7c5142f06f07",
"metadata": {},
"source": [
"白:范西屏\n",
"黑:施襄夏\n",
"共317着\n",
"黑胜"
"白:范西屏 \n",
"黑:施襄夏 \n",
"共317着 \n",
"黑胜 "
]
},
{
@@ -858,10 +858,10 @@
"id": "d42d7547-004a-4d2d-b67c-929427e80ba2",
"metadata": {},
"source": [
"白:范西屏\n",
"黑:施襄夏\n",
"共298着\n",
"白胜"
"白:范西屏 \n",
"黑:施襄夏 \n",
"共298着 \n",
"白胜 "
]
},
{
@@ -921,10 +921,10 @@
"id": "a288e7ad-45cd-4237-94ae-4c9b74eceacb",
"metadata": {},
"source": [
"白:臧念宣\n",
"黑:范西屏\n",
"共251着\n",
"白胜四子半"
"白:臧念宣 \n",
"黑:范西屏 \n",
"共251着 \n",
"白胜四子半 "
]
},
{
@@ -986,10 +986,10 @@
"id": "53fa15d5-8133-4fb2-ab30-b9b45ed0a16a",
"metadata": {},
"source": [
"白:范西屏\n",
"黑:李步青(二子)\n",
"共249着\n",
"白胜"
"白:范西屏 \n",
"黑:李步青(二子) \n",
"共249着 \n",
"白胜 "
]
},
{
@@ -1062,10 +1062,10 @@
"id": "3b71a2a4-d4b8-46ab-9809-dd212d564b93",
"metadata": {},
"source": [
"白:黄龙士\n",
"黑:徐星友(三子)\n",
"共242着\n",
"黑胜"
"白:黄龙士 \n",
"黑:徐星友(三子) \n",
"共242着 \n",
"黑胜 "
]
},
{
@@ -1128,10 +1128,10 @@
"id": "96593e55-6d5c-402c-9eff-eb2a2963dea8",
"metadata": {},
"source": [
"白:黄龙士\n",
"黑:徐星友(三子)\n",
"共122着\n",
"白胜"
"白:黄龙士 \n",
"黑:徐星友(三子) \n",
"共122着 \n",
"白胜 "
]
},
{
@@ -1189,10 +1189,10 @@
"id": "d58ea0c8-2f5d-43c1-b180-32f942e21734",
"metadata": {},
"source": [
"白:黄龙士\n",
"黑:徐星友(三子)\n",
"共118着\n",
"白胜"
"白:黄龙士 \n",
"黑:徐星友(三子) \n",
"共118着 \n",
"白胜 "
]
},
{
@@ -1241,10 +1241,10 @@
"id": "0b024a22-ca41-41d5-b52f-013028e791ed",
"metadata": {},
"source": [
"白:范西屏\n",
"黑:黄友功(三子)\n",
"共222着\n",
"白大胜"
"白:范西屏 \n",
"黑:黄友功(三子) \n",
"共222着 \n",
"白大胜 "
]
},
{