20260126
This commit is contained in:
1 parent
262b081f94
commit
b39962d282
2 files changed
+57
-55
No files matched your search
+43
-41
@@ -10,15 +10,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 22,
|
||||
"id": "272aca0e-b70c-46fe-ae58-ad8aaa5b9fa5",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2026-01-22T13:27:05.690761Z",
|
||||
"iopub.status.busy": "2026-01-22T13:27:05.690222Z",
|
||||
"iopub.status.idle": "2026-01-22T13:27:05.710714Z",
|
||||
"shell.execute_reply": "2026-01-22T13:27:05.710237Z",
|
||||
"shell.execute_reply.started": "2026-01-22T13:27:05.690707Z"
|
||||
"iopub.execute_input": "2026-01-26T00:17:22.475278Z",
|
||||
"iopub.status.busy": "2026-01-26T00:17:22.474637Z",
|
||||
"iopub.status.idle": "2026-01-26T00:17:22.498993Z",
|
||||
"shell.execute_reply": "2026-01-26T00:17:22.498203Z",
|
||||
"shell.execute_reply.started": "2026-01-26T00:17:22.475218Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -26,7 +26,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"48 ok\n"
|
||||
"30 ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -35,7 +35,7 @@
|
||||
"import json\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/中心健康检测人员.xlsx',data_only=True)\n",
|
||||
"wb = openpyxl.load_workbook('data/物华社区人员名单.xlsx',data_only=True)\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
@@ -46,11 +46,13 @@
|
||||
" dict1 = {}\n",
|
||||
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||
" \n",
|
||||
" dict1['unit'] = sheet.cell(n, 4).value\n",
|
||||
" if sheet.cell(n, 4).value is not None:\n",
|
||||
" dict1['unit'] = sheet.cell(n, 4).value\n",
|
||||
" else:\n",
|
||||
" dict1['unit'] = ''\n",
|
||||
" dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0] \n",
|
||||
" person[code] = dict1\n",
|
||||
"filename = 'data/中心健康检测人员.json'\n",
|
||||
"filename = 'data/物华社区人员.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
"print(len(person),'ok')"
|
||||
@@ -118,15 +120,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"execution_count": 23,
|
||||
"id": "32ef3c92-8644-4421-a9dd-8ae901cb2710",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2026-01-22T13:30:00.421898Z",
|
||||
"iopub.status.busy": "2026-01-22T13:30:00.420630Z",
|
||||
"iopub.status.idle": "2026-01-22T13:30:00.440823Z",
|
||||
"shell.execute_reply": "2026-01-22T13:30:00.439903Z",
|
||||
"shell.execute_reply.started": "2026-01-22T13:30:00.421820Z"
|
||||
"iopub.execute_input": "2026-01-26T00:20:02.929642Z",
|
||||
"iopub.status.busy": "2026-01-26T00:20:02.929123Z",
|
||||
"iopub.status.idle": "2026-01-26T00:20:02.939997Z",
|
||||
"shell.execute_reply": "2026-01-26T00:20:02.939492Z",
|
||||
"shell.execute_reply.started": "2026-01-26T00:20:02.929607Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -134,7 +136,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"29\n"
|
||||
"30\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -147,11 +149,11 @@
|
||||
"\n",
|
||||
"re_ta = {}\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/中心健康检测人员.json'\n",
|
||||
"filename = 'data/物华社区人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/marks_20260122.csv'\n",
|
||||
"filename = 'data/marks_20260126.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -189,7 +191,7 @@
|
||||
" score = result[4] \n",
|
||||
" re_ta[user][item_name]['成绩'] = score\n",
|
||||
"\n",
|
||||
"filename = 'data/result_中心健康检测人员.json'\n",
|
||||
"filename = 'data/result_物华社区人员.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
"print(len(re_ta))"
|
||||
@@ -205,15 +207,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": 24,
|
||||
"id": "728c6978-bc53-44e4-b986-a13d5e2cd889",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2026-01-22T13:30:37.706987Z",
|
||||
"iopub.status.busy": "2026-01-22T13:30:37.706464Z",
|
||||
"iopub.status.idle": "2026-01-22T13:30:37.725209Z",
|
||||
"shell.execute_reply": "2026-01-22T13:30:37.724253Z",
|
||||
"shell.execute_reply.started": "2026-01-22T13:30:37.706936Z"
|
||||
"iopub.execute_input": "2026-01-26T00:20:19.361876Z",
|
||||
"iopub.status.busy": "2026-01-26T00:20:19.361616Z",
|
||||
"iopub.status.idle": "2026-01-26T00:20:19.369408Z",
|
||||
"shell.execute_reply": "2026-01-26T00:20:19.368888Z",
|
||||
"shell.execute_reply.started": "2026-01-26T00:20:19.361855Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -221,7 +223,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok! 29\n"
|
||||
"ok! 30\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -232,7 +234,7 @@
|
||||
"\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",
|
||||
"filename = 'data/result_物华社区人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"for k, v in dict2.items():\n",
|
||||
@@ -255,7 +257,7 @@
|
||||
" dict2[k][item_en]['score'] = My.cal_score(data1)\n",
|
||||
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
|
||||
"\n",
|
||||
"filename = 'data/result_中心健康检测人员.json'\n",
|
||||
"filename = 'data/result_物华社区人员.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!',len(dict2)) "
|
||||
@@ -300,7 +302,7 @@
|
||||
"\n",
|
||||
"dict1 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/result_中心健康检测人员.json'\n",
|
||||
"filename = 'data/result_物华社区人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -353,15 +355,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": 25,
|
||||
"id": "d451cce5-e3a3-4909-bd13-807ddf82059a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2026-01-22T13:55:59.725677Z",
|
||||
"iopub.status.busy": "2026-01-22T13:55:59.725108Z",
|
||||
"iopub.status.idle": "2026-01-22T13:56:14.228014Z",
|
||||
"shell.execute_reply": "2026-01-22T13:56:14.226903Z",
|
||||
"shell.execute_reply.started": "2026-01-22T13:55:59.725621Z"
|
||||
"iopub.execute_input": "2026-01-26T00:22:27.314429Z",
|
||||
"iopub.status.busy": "2026-01-26T00:22:27.313838Z",
|
||||
"iopub.status.idle": "2026-01-26T00:22:41.731103Z",
|
||||
"shell.execute_reply": "2026-01-26T00:22:41.730020Z",
|
||||
"shell.execute_reply.started": "2026-01-26T00:22:27.314373Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -369,7 +371,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"29\n"
|
||||
"30\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -382,11 +384,11 @@
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_中心健康检测人员.json'\n",
|
||||
"filename = 'data/result_物华社区人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"file_path ='./中心健康检测/'\n",
|
||||
"file_path ='./物华社区/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=0\n",
|
||||
"list2 = []\n",
|
||||
@@ -396,7 +398,7 @@
|
||||
" \n",
|
||||
" id = str(k).rjust(4,\"0\")\n",
|
||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中心健康体质检测'\n",
|
||||
" mydata['title'] = '物华社区'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
|
||||
Reference in new issue
Block a user