20231212
This commit is contained in:
1 parent
54a610a08f
commit
f47c1db021
2 files changed
+103
-66
No files matched your search
+35
-41
@@ -53,15 +53,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": 29,
|
||||
"id": "dc0a78bb-ce82-4f6d-ba53-8bd9655f39af",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-28T08:21:51.973825Z",
|
||||
"iopub.status.busy": "2023-11-28T08:21:51.973366Z",
|
||||
"iopub.status.idle": "2023-11-28T08:21:52.110628Z",
|
||||
"shell.execute_reply": "2023-11-28T08:21:52.110182Z",
|
||||
"shell.execute_reply.started": "2023-11-28T08:21:51.973788Z"
|
||||
"iopub.execute_input": "2023-12-12T04:25:43.981437Z",
|
||||
"iopub.status.busy": "2023-12-12T04:25:43.980663Z",
|
||||
"iopub.status.idle": "2023-12-12T04:25:44.029168Z",
|
||||
"shell.execute_reply": "2023-12-12T04:25:44.026384Z",
|
||||
"shell.execute_reply.started": "2023-12-12T04:25:43.981364Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -70,7 +70,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"26\n"
|
||||
"32\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -87,7 +87,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20231128.csv'\n",
|
||||
"filename = 'data/Survey_20231211.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -95,7 +95,7 @@
|
||||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||||
" list1.append(line)\n",
|
||||
"dict2 = {}\n",
|
||||
"m_rq = '2023-11-20'\n",
|
||||
"m_rq = '2023-12-11'\n",
|
||||
"rq= date.fromisoformat(m_rq.replace('/','-'))\n",
|
||||
"for item in list1:\n",
|
||||
" if item[2] in dict1.keys(): \n",
|
||||
@@ -131,15 +131,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 30,
|
||||
"id": "5b646b5d-c4f6-4d37-9510-30fcbef44855",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-28T08:22:06.586472Z",
|
||||
"iopub.status.busy": "2023-11-28T08:22:06.586205Z",
|
||||
"iopub.status.idle": "2023-11-28T08:22:06.590979Z",
|
||||
"shell.execute_reply": "2023-11-28T08:22:06.590514Z",
|
||||
"shell.execute_reply.started": "2023-11-28T08:22:06.586440Z"
|
||||
"iopub.execute_input": "2023-12-12T04:25:52.599199Z",
|
||||
"iopub.status.busy": "2023-12-12T04:25:52.598384Z",
|
||||
"iopub.status.idle": "2023-12-12T04:25:52.621363Z",
|
||||
"shell.execute_reply": "2023-12-12T04:25:52.618548Z",
|
||||
"shell.execute_reply.started": "2023-12-12T04:25:52.599125Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -148,13 +148,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"13501017366 程大庆\n",
|
||||
"13910270600 袁正东\n",
|
||||
"13501017663 李志玖\n",
|
||||
"13901363461 陈学军\n",
|
||||
"13911795921 祁向东\n",
|
||||
"18600419150 鲁兴隆\n",
|
||||
"17316020604 刘凡\n"
|
||||
"13910270600 袁正东\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -169,7 +163,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20231128.csv'\n",
|
||||
"filename = 'data/Survey_20231211.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -226,15 +220,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 33,
|
||||
"id": "ab9b8e0c-53dd-4b93-a42a-7d1952b0423a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-21T02:43:16.230464Z",
|
||||
"iopub.status.busy": "2023-11-21T02:43:16.229691Z",
|
||||
"iopub.status.idle": "2023-11-21T02:43:18.707519Z",
|
||||
"shell.execute_reply": "2023-11-21T02:43:18.706897Z",
|
||||
"shell.execute_reply.started": "2023-11-21T02:43:16.230392Z"
|
||||
"iopub.execute_input": "2023-12-12T04:36:12.507368Z",
|
||||
"iopub.status.busy": "2023-12-12T04:36:12.507004Z",
|
||||
"iopub.status.idle": "2023-12-12T04:36:18.957893Z",
|
||||
"shell.execute_reply": "2023-12-12T04:36:18.955648Z",
|
||||
"shell.execute_reply.started": "2023-12-12T04:36:12.507335Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -265,8 +259,16 @@
|
||||
"15810404851 王建斌 {\"errmsg\":\"ok\"}\n",
|
||||
"15810830119 奚晓亮 {\"errmsg\":\"ok\"}\n",
|
||||
"13651123781 马海涛 {\"errmsg\":\"ok\"}\n",
|
||||
"17310308917 刘凡 {\"errmsg\":\"ok\"}\n",
|
||||
"13651357627 高桂所 {\"errmsg\":\"ok\"}\n",
|
||||
"13718793001 乔金梅 {\"errmsg\":\"ok\"}\n"
|
||||
"13718793001 乔金梅 {\"errmsg\":\"ok\"}\n",
|
||||
"15501167098 马宇 {\"errmsg\":\"ok\"}\n",
|
||||
"13601312169 白华 {\"errmsg\":\"ok\"}\n",
|
||||
"13901363461 陈学军 {\"errmsg\":\"ok\"}\n",
|
||||
"13501017663 李志玖 {\"errmsg\":\"ok\"}\n",
|
||||
"13911795921 祁向东 {\"errmsg\":\"ok\"}\n",
|
||||
"18600419150 鲁兴隆 {\"errmsg\":\"ok\"}\n",
|
||||
"13501017366 程大庆 {\"errmsg\":\"ok\"}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -283,7 +285,7 @@
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"fiie_path ='./政法委1/'\n",
|
||||
"fiie_path ='./农工党延庆支部/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i = 27\n",
|
||||
"list2 = []\n",
|
||||
@@ -291,7 +293,7 @@
|
||||
" list1 = []\n",
|
||||
" mydata = {} \n",
|
||||
" id = k.rjust(3,\"0\")\n",
|
||||
" mydata['path'] = fiie_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['path'] = fiie_path+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '农工党延庆支部'\n",
|
||||
" #mydata['subtitle'] = ''\n",
|
||||
" mydata['id'] = id\n",
|
||||
@@ -306,15 +308,7 @@
|
||||
" mydata.setdefault('surveys',{})\n",
|
||||
" mydata['surveys']['tcm'] = v['tcm']\n",
|
||||
" \n",
|
||||
" mydata['fits'] = {}\n",
|
||||
" #mydata.setdefault('fits',{})\n",
|
||||
" for item in list_item:\n",
|
||||
" if item in dict1[k].keys():\n",
|
||||
" if item in ['lung','pushup','step','situp']:\n",
|
||||
" mark = dict1[k][item]['成绩'].split()[0].split('.')[0]\n",
|
||||
" else:\n",
|
||||
" mark = dict1[k][item]['成绩'].split()[0]\n",
|
||||
" mydata['fits'][item] = {'mark':mark,'score':dict1[k][item]['score']}\n",
|
||||
" \n",
|
||||
" #print(mydata) \n",
|
||||
" \n",
|
||||
" list1.append(mydata)\n",
|
||||
|
||||
+68
-25
@@ -1177,35 +1177,47 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 30,
|
||||
"id": "714d4a20-9ca0-4439-880b-f68de8c0e2fb",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-12T04:23:01.972390Z",
|
||||
"iopub.status.busy": "2023-12-12T04:23:01.971582Z",
|
||||
"iopub.status.idle": "2023-12-12T04:23:02.066623Z",
|
||||
"shell.execute_reply": "2023-12-12T04:23:02.064926Z",
|
||||
"shell.execute_reply.started": "2023-12-12T04:23:01.972317Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/职工健康提升项目志愿者报名表(汇总).xlsx')\n",
|
||||
"wb = openpyxl.load_workbook('data/副本2023年安庆石化职工健康提升项目志愿者花名册.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
"\n",
|
||||
"for n in range(3, sheet.max_row+1):\n",
|
||||
"for n in range(2, sheet.max_row+1):\n",
|
||||
" code = int(sheet.cell(n, 1).value)\n",
|
||||
" person.setdefault(code, {})\n",
|
||||
" dict1 = {}\n",
|
||||
" dict1['name'] = sheet.cell(n, 4).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 5).value\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",
|
||||
" dict1['job'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['age'] = int(sheet.cell(n, 6).value)\n",
|
||||
" dict1['phone'] = str(sheet.cell(n,7).value)\n",
|
||||
" dict1['note'] = sheet.cell(n,8).value\n",
|
||||
" dict1['phone'] = str(sheet.cell(n,5).value)\n",
|
||||
" person[code] = dict1\n",
|
||||
"filename = 'data/安庆职工健康提升志愿者.json'\n",
|
||||
"filename = 'data/安庆职工健康提升志愿者1.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
"print('ok')"
|
||||
@@ -1221,15 +1233,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"execution_count": 31,
|
||||
"id": "dcdd18b3-d7b7-49b1-b148-c2ea9a7799ff",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-21T03:09:53.451357Z",
|
||||
"iopub.status.busy": "2023-11-21T03:09:53.450510Z",
|
||||
"iopub.status.idle": "2023-11-21T03:09:53.535389Z",
|
||||
"shell.execute_reply": "2023-11-21T03:09:53.534089Z",
|
||||
"shell.execute_reply.started": "2023-11-21T03:09:53.451280Z"
|
||||
"iopub.execute_input": "2023-12-12T04:23:54.507193Z",
|
||||
"iopub.status.busy": "2023-12-12T04:23:54.506388Z",
|
||||
"iopub.status.idle": "2023-12-12T04:23:54.583968Z",
|
||||
"shell.execute_reply": "2023-12-12T04:23:54.582552Z",
|
||||
"shell.execute_reply.started": "2023-12-12T04:23:54.507133Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -1247,7 +1259,7 @@
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"filename = 'data/安庆职工健康提升志愿者.json'\n",
|
||||
"filename = 'data/安庆职工健康提升志愿者1.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
@@ -1255,7 +1267,7 @@
|
||||
"wj_dm = {'psy_0556_sh':0,'tcm_0556_sh':1,'spine_0556_sh':2}\n",
|
||||
"list1 = []\n",
|
||||
"re_ta = {}\n",
|
||||
"filename = 'data/Survey_20231121.csv'\n",
|
||||
"filename = 'data/Survey_20231211-1702260996888.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -1286,15 +1298,13 @@
|
||||
" list2.append(item)\n",
|
||||
" list1.append(list2)\n",
|
||||
" \n",
|
||||
"filename = 'data/安庆职工健康提升问卷情况表.xlsx'\n",
|
||||
"filename = 'data/安庆职工健康提升问卷情况表20231212.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"title = ['编号','员工姓名','手机号码','心理','中医','脊柱']\n",
|
||||
"sheet.append(title)\n",
|
||||
"for row in list1:\n",
|
||||
" sheet.append(row)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"wb.save(filename) \n",
|
||||
" "
|
||||
]
|
||||
@@ -1309,12 +1319,45 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 29,
|
||||
"id": "ea4fffc4-3c6e-4f85-819f-52f969e04dd7",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-12T04:06:50.977355Z",
|
||||
"iopub.status.busy": "2023-12-12T04:06:50.976552Z",
|
||||
"iopub.status.idle": "2023-12-12T04:06:51.007761Z",
|
||||
"shell.execute_reply": "2023-12-12T04:06:51.005174Z",
|
||||
"shell.execute_reply.started": "2023-12-12T04:06:50.977281Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"18055696268\n",
|
||||
"13865166211\n",
|
||||
"13966607917\n",
|
||||
"13855640093\n",
|
||||
"18155688687\n",
|
||||
"15156230686\n",
|
||||
"13074076020\n",
|
||||
"18655663060\n",
|
||||
"15905566828\n",
|
||||
"13905562130\n",
|
||||
"13855602427\n",
|
||||
"13966613066\n",
|
||||
"15856585658\n",
|
||||
"13909669602\n",
|
||||
"18055691637\n",
|
||||
"18755696791\n",
|
||||
"19955611658\n",
|
||||
"13966637322\n",
|
||||
"13955603120\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
@@ -1329,7 +1372,7 @@
|
||||
"for k,v in dict1.items():\n",
|
||||
" phone.add(v['phone'])\n",
|
||||
"\n",
|
||||
"filename = 'data/Survey_20231018.csv'\n",
|
||||
"filename = 'data/Survey_20231211-1702260996888.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
|
||||
Reference in new issue
Block a user