This commit is contained in:
512song committed 2025-02-16 23:39:56 +08:00
1 parent c801f150ae
commit adfaa3c638
2 files changed
+581 -34

No files matched your search

+105 -34
View File
@@ -10,15 +10,15 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 58,
"id": "3d5ddc7a-a331-438d-aa8d-1ad74c7250d0",
"metadata": {
"execution": {
"iopub.execute_input": "2024-12-24T04:10:44.463102Z",
"iopub.status.busy": "2024-12-24T04:10:44.462345Z",
"iopub.status.idle": "2024-12-24T04:10:44.481670Z",
"shell.execute_reply": "2024-12-24T04:10:44.480911Z",
"shell.execute_reply.started": "2024-12-24T04:10:44.463032Z"
"iopub.execute_input": "2024-12-30T03:53:32.228359Z",
"iopub.status.busy": "2024-12-30T03:53:32.227594Z",
"iopub.status.idle": "2024-12-30T03:53:32.259237Z",
"shell.execute_reply": "2024-12-30T03:53:32.258469Z",
"shell.execute_reply.started": "2024-12-30T03:53:32.228287Z"
}
},
"outputs": [
@@ -57,15 +57,15 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 57,
"id": "7b218973-965d-4324-9553-d8e7ddfda4cd",
"metadata": {
"execution": {
"iopub.execute_input": "2024-12-24T14:48:29.843853Z",
"iopub.status.busy": "2024-12-24T14:48:29.843106Z",
"iopub.status.idle": "2024-12-24T14:48:29.865282Z",
"shell.execute_reply": "2024-12-24T14:48:29.864798Z",
"shell.execute_reply.started": "2024-12-24T14:48:29.843783Z"
"iopub.execute_input": "2024-12-30T03:53:26.067733Z",
"iopub.status.busy": "2024-12-30T03:53:26.067165Z",
"iopub.status.idle": "2024-12-30T03:53:26.096201Z",
"shell.execute_reply": "2024-12-30T03:53:26.095650Z",
"shell.execute_reply.started": "2024-12-30T03:53:26.067679Z"
}
},
"outputs": [
@@ -164,15 +164,15 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 59,
"id": "72ec680f-ec0d-44f9-919c-17c8e614b885",
"metadata": {
"execution": {
"iopub.execute_input": "2024-12-24T04:10:51.916961Z",
"iopub.status.busy": "2024-12-24T04:10:51.916210Z",
"iopub.status.idle": "2024-12-24T04:10:51.929768Z",
"shell.execute_reply": "2024-12-24T04:10:51.928679Z",
"shell.execute_reply.started": "2024-12-24T04:10:51.916890Z"
"iopub.execute_input": "2024-12-30T03:53:44.735069Z",
"iopub.status.busy": "2024-12-30T03:53:44.734455Z",
"iopub.status.idle": "2024-12-30T03:53:44.750814Z",
"shell.execute_reply": "2024-12-30T03:53:44.749894Z",
"shell.execute_reply.started": "2024-12-30T03:53:44.735012Z"
}
},
"outputs": [
@@ -180,7 +180,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
"2\n"
]
}
],
@@ -197,7 +197,7 @@
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/marks_20241224.csv'\n",
"filename = 'data/marks_20241230.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -248,15 +248,15 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 60,
"id": "8f459ed3-fc14-404f-998b-5ed2a15958c3",
"metadata": {
"execution": {
"iopub.execute_input": "2024-12-24T04:10:56.430593Z",
"iopub.status.busy": "2024-12-24T04:10:56.429864Z",
"iopub.status.idle": "2024-12-24T04:10:56.441856Z",
"shell.execute_reply": "2024-12-24T04:10:56.440815Z",
"shell.execute_reply.started": "2024-12-24T04:10:56.430526Z"
"iopub.execute_input": "2024-12-30T03:53:47.996998Z",
"iopub.status.busy": "2024-12-30T03:53:47.996390Z",
"iopub.status.idle": "2024-12-30T03:53:48.008881Z",
"shell.execute_reply": "2024-12-30T03:53:48.007779Z",
"shell.execute_reply.started": "2024-12-30T03:53:47.996943Z"
}
},
"outputs": [
@@ -314,15 +314,15 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 61,
"id": "9e843585-fef3-4f5c-baae-76e711f2a42f",
"metadata": {
"execution": {
"iopub.execute_input": "2024-12-24T04:10:59.919975Z",
"iopub.status.busy": "2024-12-24T04:10:59.919307Z",
"iopub.status.idle": "2024-12-24T04:11:00.529956Z",
"shell.execute_reply": "2024-12-24T04:11:00.528814Z",
"shell.execute_reply.started": "2024-12-24T04:10:59.919919Z"
"iopub.execute_input": "2024-12-30T03:53:52.564652Z",
"iopub.status.busy": "2024-12-30T03:53:52.563867Z",
"iopub.status.idle": "2024-12-30T03:53:53.803154Z",
"shell.execute_reply": "2024-12-30T03:53:53.801991Z",
"shell.execute_reply.started": "2024-12-30T03:53:52.564567Z"
}
},
"outputs": [
@@ -330,7 +330,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
"2\n"
]
}
],
@@ -396,10 +396,81 @@
"print(i)"
]
},
{
"cell_type": "markdown",
"id": "582e988f-3226-4209-a348-60be2a7750a1",
"metadata": {},
"source": [
"## 导出测试人员信息"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "93feeeb4-85ea-48e9-9358-0efa00725ede",
"metadata": {
"execution": {
"iopub.execute_input": "2024-12-25T09:41:41.941523Z",
"iopub.status.busy": "2024-12-25T09:41:41.940791Z",
"iopub.status.idle": "2024-12-25T09:41:41.965245Z",
"shell.execute_reply": "2024-12-25T09:41:41.964792Z",
"shell.execute_reply.started": "2024-12-25T09:41:41.941453Z"
}
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"items = ['lung','grip','flexion','jump','pushup','situp','balance','reaction','step']\n",
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\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 dict1.items():\n",
" list2 = []\n",
" list2.append(str(k).rjust(5,'0'))\n",
" list2.append(v['name']) \n",
" list2.append(dict2[k]['sex'])\n",
" list2.append('新疆')\n",
" if 'bmi' in v.keys():\n",
" height = v['bmi']['成绩'].split(',')[0]\n",
" weight = v['bmi']['成绩'].split(',')[1]\n",
" list2.append(height)\n",
" list2.append(weight)\n",
" else:\n",
" list2.append('')\n",
" list2.append('')\n",
" for item in items:\n",
" if item in v.keys():\n",
" list2.append(v[item]['成绩']) \n",
" elif item =='name':\n",
" list2.append(v[item])\n",
" else:\n",
" list2.append('')\n",
" \n",
" list1.append(list2)\n",
"filename = 'data/新疆体测情况表241225.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": null,
"id": "13722e88-9f6a-421e-8fb3-2fccd0741452",
"id": "f44c57ed-aac8-481a-9126-0dadcbe0190c",
"metadata": {},
"outputs": [],
"source": []