20250629
This commit is contained in:
1 parent
678a2c983d
commit
b58fc4376a
4 files changed
+1023
-365
No files matched your search
+56
-56
@@ -10,15 +10,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 2,
|
||||
"id": "eb9aa782-ce2c-4814-bdf6-92c7e892854d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-03-13T02:11:09.976784Z",
|
||||
"iopub.status.busy": "2025-03-13T02:11:09.976043Z",
|
||||
"iopub.status.idle": "2025-03-13T02:11:09.999996Z",
|
||||
"shell.execute_reply": "2025-03-13T02:11:09.999500Z",
|
||||
"shell.execute_reply.started": "2025-03-13T02:11:09.976712Z"
|
||||
"iopub.execute_input": "2025-06-27T07:52:20.116852Z",
|
||||
"iopub.status.busy": "2025-06-27T07:52:20.116187Z",
|
||||
"iopub.status.idle": "2025-06-27T07:52:20.147516Z",
|
||||
"shell.execute_reply": "2025-06-27T07:52:20.146947Z",
|
||||
"shell.execute_reply.started": "2025-06-27T07:52:20.116789Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -26,7 +26,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"49\n",
|
||||
"51\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
"import json\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/海淀老干部局第一期.xlsx')\n",
|
||||
"wb = openpyxl.load_workbook('data/海淀老干部局第二期.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
@@ -47,13 +47,13 @@
|
||||
" dict1 = {}\n",
|
||||
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['unit'] = '第一期'\n",
|
||||
" dict1['unit'] = '第二期'\n",
|
||||
" dict1['birth'] = str(sheet.cell(n, 4).value).replace('/','-').split(' ')[0]\n",
|
||||
" dict1['id'] = sheet.cell(n, 5).value\n",
|
||||
" if sheet.cell(n,6).value is not None:\n",
|
||||
" dict1['phone'] = str(sheet.cell(n,6).value) \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))\n",
|
||||
@@ -122,15 +122,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": 6,
|
||||
"id": "fd005ed3-24ee-4b39-a619-6c83e64c2852",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-03-18T08:59:51.660525Z",
|
||||
"iopub.status.busy": "2025-03-18T08:59:51.660023Z",
|
||||
"iopub.status.idle": "2025-03-18T08:59:51.676922Z",
|
||||
"shell.execute_reply": "2025-03-18T08:59:51.676147Z",
|
||||
"shell.execute_reply.started": "2025-03-18T08:59:51.660475Z"
|
||||
"iopub.execute_input": "2025-06-27T08:01:00.773765Z",
|
||||
"iopub.status.busy": "2025-06-27T08:01:00.772994Z",
|
||||
"iopub.status.idle": "2025-06-27T08:01:00.788351Z",
|
||||
"shell.execute_reply": "2025-06-27T08:01:00.787439Z",
|
||||
"shell.execute_reply.started": "2025-06-27T08:01:00.773693Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -138,7 +138,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"40\n"
|
||||
"30\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -151,11 +151,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_20250318.csv'\n",
|
||||
"filename = 'data/marks_20250627.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -190,7 +190,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))"
|
||||
@@ -206,15 +206,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": 7,
|
||||
"id": "9481765c-92b7-4a58-b192-582bb001f167",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-03-18T08:59:58.639366Z",
|
||||
"iopub.status.busy": "2025-03-18T08:59:58.638697Z",
|
||||
"iopub.status.idle": "2025-03-18T08:59:58.654499Z",
|
||||
"shell.execute_reply": "2025-03-18T08:59:58.653527Z",
|
||||
"shell.execute_reply.started": "2025-03-18T08:59:58.639304Z"
|
||||
"iopub.execute_input": "2025-06-27T08:01:04.771410Z",
|
||||
"iopub.status.busy": "2025-06-27T08:01:04.770655Z",
|
||||
"iopub.status.idle": "2025-06-27T08:01:04.784375Z",
|
||||
"shell.execute_reply": "2025-06-27T08:01:04.783184Z",
|
||||
"shell.execute_reply.started": "2025-06-27T08:01:04.771340Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -233,7 +233,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",
|
||||
@@ -256,7 +256,7 @@
|
||||
" dict2[k][item_en]['score'] = My.cal_score(data1)\n",
|
||||
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
|
||||
"\n",
|
||||
"filename = f'data/result_海淀区老干部大学第一期.json'\n",
|
||||
"filename = f'data/result_海淀区老干部大学第二期.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!') "
|
||||
@@ -272,15 +272,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 15,
|
||||
"id": "63c81b75-9b3d-4001-a5da-32b7cf992843",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-03-11T06:54:01.231518Z",
|
||||
"iopub.status.busy": "2025-03-11T06:54:01.230854Z",
|
||||
"iopub.status.idle": "2025-03-11T06:54:01.260859Z",
|
||||
"shell.execute_reply": "2025-03-11T06:54:01.260166Z",
|
||||
"shell.execute_reply.started": "2025-03-11T06:54:01.231459Z"
|
||||
"iopub.execute_input": "2025-06-29T01:24:19.165326Z",
|
||||
"iopub.status.busy": "2025-06-29T01:24:19.164670Z",
|
||||
"iopub.status.idle": "2025-06-29T01:24:19.203326Z",
|
||||
"shell.execute_reply": "2025-06-29T01:24:19.202250Z",
|
||||
"shell.execute_reply.started": "2025-06-29T01:24:19.165268Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -300,7 +300,7 @@
|
||||
"bmi = ['height','weight']\n",
|
||||
"title = ['编号','姓名','性别','身高','体重','bmi','肺活量','得分','握力','得分','坐位体前屈','得分','纵跳','得分','俯卧撑','得分','一分钟仰卧起坐','得分','单脚站立','得分','选择反应时','得分','台阶指数','得分']\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",
|
||||
@@ -334,7 +334,7 @@
|
||||
" list2.append('') \n",
|
||||
" if i>2:\n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/海淀区老干部大学第一期.xlsx'\n",
|
||||
"filename = 'data/海淀区老干部大学第二期.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -355,15 +355,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": 13,
|
||||
"id": "dd8ed4fe-5014-455f-993d-64a41519de6d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-03-18T09:00:09.951390Z",
|
||||
"iopub.status.busy": "2025-03-18T09:00:09.949962Z",
|
||||
"iopub.status.idle": "2025-03-18T09:00:09.977680Z",
|
||||
"shell.execute_reply": "2025-03-18T09:00:09.977238Z",
|
||||
"shell.execute_reply.started": "2025-03-18T09:00:09.951310Z"
|
||||
"iopub.execute_input": "2025-06-27T08:18:07.185139Z",
|
||||
"iopub.status.busy": "2025-06-27T08:18:07.184397Z",
|
||||
"iopub.status.idle": "2025-06-27T08:18:07.209650Z",
|
||||
"shell.execute_reply": "2025-06-27T08:18:07.208728Z",
|
||||
"shell.execute_reply.started": "2025-06-27T08:18:07.185073Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -371,7 +371,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"36\n"
|
||||
"27\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -384,10 +384,10 @@
|
||||
"\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",
|
||||
"filename = 'data/海淀区老干部大学第一期.json'\n",
|
||||
"filename = 'data/海淀区老干部大学第二期.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -397,7 +397,7 @@
|
||||
" phone[v['phone']] = k\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20250318.csv'\n",
|
||||
"filename = 'data/Survey_20250627.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -453,7 +453,7 @@
|
||||
" dict1[phone[item[2]]]['month'] = int(days/365*12)\n",
|
||||
" #print(phone[item[2]])\n",
|
||||
" nn+=1\n",
|
||||
"filename = 'data/result_海淀区老干部大学第一期-1.json'\n",
|
||||
"filename = 'data/result_海淀区老干部大学第二期-1.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False)\n",
|
||||
@@ -470,15 +470,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": 14,
|
||||
"id": "b8b2fc93-9e8b-4bde-bc13-2de179de2b2d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-03-18T09:00:27.649247Z",
|
||||
"iopub.status.busy": "2025-03-18T09:00:27.648488Z",
|
||||
"iopub.status.idle": "2025-03-18T09:00:49.222330Z",
|
||||
"shell.execute_reply": "2025-03-18T09:00:49.221284Z",
|
||||
"shell.execute_reply.started": "2025-03-18T09:00:27.649176Z"
|
||||
"iopub.execute_input": "2025-06-27T08:18:23.717064Z",
|
||||
"iopub.status.busy": "2025-06-27T08:18:23.716302Z",
|
||||
"iopub.status.idle": "2025-06-27T08:18:40.822028Z",
|
||||
"shell.execute_reply": "2025-06-27T08:18:40.821014Z",
|
||||
"shell.execute_reply.started": "2025-06-27T08:18:23.716991Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -486,7 +486,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"40\n"
|
||||
"33\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -499,11 +499,11 @@
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_海淀区老干部大学第一期-1.json'\n",
|
||||
"filename = 'data/result_海淀区老干部大学第二期-1.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",
|
||||
|
||||
Reference in new issue
Block a user