250251215
This commit is contained in:
1 parent
c19ca272d7
commit
6803e6fff6
6 files changed
+1464
-620
No files matched your search
+306
-53
@@ -991,17 +991,16 @@
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
"for n in range(2, sheet.max_row+1):\n",
|
||||
" code = int(sheet.cell(n, 2).value)\n",
|
||||
" code = str(int(sheet.cell(n, 2).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, 6).value\n",
|
||||
" \n",
|
||||
" \n",
|
||||
" dict1['unit'] = sheet.cell(n, 6).value \n",
|
||||
" dict1['age'] = int(sheet.cell(n, 5).value)\n",
|
||||
" dict1['symptoms'] = sheet.cell(n, 8).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),'ok')"
|
||||
@@ -1017,21 +1016,40 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "f60e8194-7ef6-49d8-8538-9b79f35bb64d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"execution_count": 28,
|
||||
"id": "7261e146-03f5-4943-8a3a-479d0e4a025d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-09T09:50:57.787016Z",
|
||||
"iopub.status.busy": "2025-12-09T09:50:57.786321Z",
|
||||
"iopub.status.idle": "2025-12-09T09:50:57.827675Z",
|
||||
"shell.execute_reply": "2025-12-09T09:50:57.827125Z",
|
||||
"shell.execute_reply.started": "2025-12-09T09:50:57.786958Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"204 ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"##### import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/宁夏能化高危风险干预人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
" \n",
|
||||
"dict1 = {}\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/sql_20251009.csv'\n",
|
||||
"filename = 'data/sql_20251209.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -1041,10 +1059,10 @@
|
||||
"nn = 0\n",
|
||||
"for item in list1:\n",
|
||||
" dict2 = {}\n",
|
||||
" name = item[1]\n",
|
||||
" phone = str(item[2])[2:]\n",
|
||||
" birth = str(item[4])\n",
|
||||
" content = json.loads(item[0])\n",
|
||||
" name = item[2]\n",
|
||||
" phone = str(item[3])[2:]\n",
|
||||
" birth = str(item[5])\n",
|
||||
" content = json.loads(item[1])\n",
|
||||
" tcm = []\n",
|
||||
" for i in range(0,60):\n",
|
||||
" tcm.append(0)\n",
|
||||
@@ -1055,26 +1073,177 @@
|
||||
" i = int(k[3:])\n",
|
||||
" tcm[i-1] = int(v)\n",
|
||||
" \n",
|
||||
" code = int(dict2['code'])\n",
|
||||
" dict1.setdefault(code,{})\n",
|
||||
" dict1[code]['name'] = dict2['name']\n",
|
||||
" if dict2['gender'] == 'm':\n",
|
||||
" dict1[code]['sex'] = '男'\n",
|
||||
" else:\n",
|
||||
" dict1[code]['sex'] = '女'\n",
|
||||
" dict1[code]['birth'] = str(item[4])\n",
|
||||
" dict1[code]['unit'] = dict2['unit']\n",
|
||||
" dict1[code]['phone'] = phone\n",
|
||||
" dict1[code]['waist'] = dict2['waist']\n",
|
||||
" dict1[code]['hip'] = dict2['hip']\n",
|
||||
" dict1[code]['tcm'] = tcm\n",
|
||||
"filename = 'data/survey_宁夏能化干预人员.json'\n",
|
||||
" code = str(int(dict2['code']))\n",
|
||||
" if code in dict3.keys():\n",
|
||||
" dict1.setdefault(code,{})\n",
|
||||
" dict1[code]['name'] = dict2['name']\n",
|
||||
" if dict2['gender'] == 'm':\n",
|
||||
" dict1[code]['sex'] = '男'\n",
|
||||
" else:\n",
|
||||
" dict1[code]['sex'] = '女'\n",
|
||||
" dict1[code]['birth'] = str(item[4])\n",
|
||||
" dict1[code]['unit'] = dict2['unit']\n",
|
||||
" dict1[code]['age'] = dict3[code]['age']\n",
|
||||
" dict1[code]['phone'] = phone\n",
|
||||
" dict1[code]['waist'] = dict2['waist']\n",
|
||||
" dict1[code]['hip'] = dict2['hip']\n",
|
||||
" dict1[code]['tcm'] = tcm\n",
|
||||
"filename = 'data/survey_宁夏能化高危风险干预人员.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False)\n",
|
||||
"print(len(dict1),'ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c4486c37-d1a4-460f-9997-6405c51b805c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 常用参数及自定义函数"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 30,
|
||||
"id": "34cb26d7-cd7b-4ad5-bb7b-71cfcce16c24",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-09T09:51:13.116856Z",
|
||||
"iopub.status.busy": "2025-12-09T09:51:13.116051Z",
|
||||
"iopub.status.idle": "2025-12-09T09:51:13.133080Z",
|
||||
"shell.execute_reply": "2025-12-09T09:51:13.132231Z",
|
||||
"shell.execute_reply.started": "2025-12-09T09:51:13.116787Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"questions = [[1],[-1, 2],[-1, 2],[-1, 8],[-1, 3],[1],[-1],[-1, 7],[2],[2],[2],[2, 3],[2],[2],[3],[3],[3],[3],[3],[4],[4],[4],[4],[4],[4],[4],[4],[5], [5],[5],[5],[5],[5],[5],[5],[6],[6],[6],[6],[6],[6],[7],[7],[7],[7],[7],[7],[8],[8],[8],[8],[8],[8],[9],[9],[9],[9],[9],[9],[9]]\n",
|
||||
"\n",
|
||||
"kinds = ['平和','气虚','阳虚','阴虚','痰湿','湿热','血瘀','气郁','特禀']\n",
|
||||
"\n",
|
||||
"def tcm_calc(arr):\n",
|
||||
" qa = [8, 8, 7, 8, 8, 6, 7, 7, 7]\n",
|
||||
" s = [0] * 9\n",
|
||||
" for i in range(len(questions)):\n",
|
||||
" m = arr[i] - 1\n",
|
||||
" for v in questions[i]:\n",
|
||||
" if v < 0:\n",
|
||||
" s[-v - 1] += 4 - m\n",
|
||||
" else:\n",
|
||||
" s[v - 1] += m\n",
|
||||
" return [int((v / qa[i]) * 25) for i, v in enumerate(s)]\n",
|
||||
"\n",
|
||||
"def tcm_kind(score):\n",
|
||||
" kind = 0\n",
|
||||
" near = False\n",
|
||||
" max_kind = 0\n",
|
||||
" max_score = 0\n",
|
||||
" for i in range(1, 9):\n",
|
||||
" if score[i] > max_score:\n",
|
||||
" max_kind = i\n",
|
||||
" max_score = score[i]\n",
|
||||
" if score[0] >= 60 and max_score < 40:\n",
|
||||
" if max_score >= 30:\n",
|
||||
" near = True\n",
|
||||
" kind = max_kind\n",
|
||||
" else:\n",
|
||||
" kind = max_kind\n",
|
||||
" return {\n",
|
||||
" \"kind\": kind,\n",
|
||||
" \"near\": near\n",
|
||||
" }\n",
|
||||
"list2 = ['成就感','愉快心境','放松程度','压力应对','体力充沛','情感充沛度']\n",
|
||||
"list3 = [[5,7],[7,4],[7,4],[7,4],[8,1],[6,1]] \n",
|
||||
"list4 = ['颈椎','胸椎','腰椎','骶尾椎']\n",
|
||||
"list5 = [[0,10,10],[10,17,7],[17,24,6],[24,26,2]]\n",
|
||||
"qb = [\n",
|
||||
" 1, 1, 1, 1, 1,\n",
|
||||
" 4, 3, 2, 3, 2, 4, 3,\n",
|
||||
" 4, 3, 2, 4, 4, 2, 4,\n",
|
||||
" 3, 2, 2, 4, 3, 3, 2,\n",
|
||||
" 5, 5, 5, 5, 5, 5, 5, 5,\n",
|
||||
" 6, 6, 6, 6, 6, 6\n",
|
||||
" ]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "f0bae0b0-2edb-4d3e-a2ae-154d23fea48b",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 导出问卷监测情况表"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"id": "d78c0f3f-cd1a-4c6c-9f5b-b1b874a95fe3",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-09T09:52:01.947920Z",
|
||||
"iopub.status.busy": "2025-12-09T09:52:01.947633Z",
|
||||
"iopub.status.idle": "2025-12-09T09:52:01.999096Z",
|
||||
"shell.execute_reply": "2025-12-09T09:52:01.998620Z",
|
||||
"shell.execute_reply.started": "2025-12-09T09:52:01.947897Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/survey_宁夏能化高危风险干预人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"data_list = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" list6 = []\n",
|
||||
" list6.append(str(k).rjust(4,'0'))\n",
|
||||
" list6.append(v['name'])\n",
|
||||
" list6.append(v['sex'])\n",
|
||||
" list6.append(v['unit'])\n",
|
||||
" list6.append(v['age'])\n",
|
||||
" list6.append(v['waist'])\n",
|
||||
" list6.append(v['hip'])\n",
|
||||
" \n",
|
||||
" if 'tcm' in v.keys():\n",
|
||||
" list1 = []\n",
|
||||
" tcm =v['tcm']\n",
|
||||
" for item in tcm:\n",
|
||||
" list1.append(item)\n",
|
||||
" score = tcm_calc(list1)\n",
|
||||
"\n",
|
||||
" result = tcm_kind(score)\n",
|
||||
" kind = result['kind']\n",
|
||||
" near = result['near']\n",
|
||||
" #print(k,kinds[kind], near, score)\n",
|
||||
" list6.append(kinds[kind])\n",
|
||||
" if near:\n",
|
||||
" list6.append('是')\n",
|
||||
" else:\n",
|
||||
" list6.append('')\n",
|
||||
" for item in score:\n",
|
||||
" list6.append(item)\n",
|
||||
" else:\n",
|
||||
" for i in range(0,11):\n",
|
||||
" list6.append('')\n",
|
||||
" i+=1\n",
|
||||
" \n",
|
||||
" data_list.append(list6)\n",
|
||||
"filename = 'data/宁夏能化高危风险干预人员体质问卷明细表(20251209).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"title = ['编号', '姓名', '性别', '单位/部门', '年龄', '腰围', '臀围', '中医体质', '是否倾向', '平和', '气虚', '阳虚', '阴虚', '痰湿', '湿热', '血瘀', '气郁', '特禀']\n",
|
||||
"sheet.append(title)\n",
|
||||
"for row in data_list:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "93a9b31e-49ea-45cd-bb0b-5c3db19bbb54",
|
||||
@@ -1121,6 +1290,14 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "4b0cd38c-d14c-48e7-83cb-8afc7665b060",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# 体重管理系统"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "98de56de-95fe-4f21-be25-896fb1bda175",
|
||||
@@ -1131,9 +1308,17 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 1,
|
||||
"id": "22be8f39-afbb-448a-8ae6-c825c7d38757",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-14T23:43:21.978932Z",
|
||||
"iopub.status.busy": "2025-12-14T23:43:21.978409Z",
|
||||
"iopub.status.idle": "2025-12-14T23:43:22.273147Z",
|
||||
"shell.execute_reply": "2025-12-14T23:43:22.272647Z",
|
||||
"shell.execute_reply.started": "2025-12-14T23:43:21.978883Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -1142,7 +1327,7 @@
|
||||
"\n",
|
||||
"title = []\n",
|
||||
"\n",
|
||||
"filename = 'data/surveys_records_2025-12-07.json'\n",
|
||||
"filename = 'data/surveys_records_2025-12-15.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
@@ -1167,7 +1352,7 @@
|
||||
" \n",
|
||||
" list1.append(list2)\n",
|
||||
"all_title = ['id', 'date_created','name', 'gender', 'birth', 'code', 'unit', 'height', 'weight', 'next_weight', 'waist', 'hip', 'level4', 'level3', 'level2', 'recipe', 'level1', 'last_level4', 'last_level3', 'last_level2', 'last_level1', 'last_recipe', 'last_lose', 'last_sport', 'sport_type', 'sport_duration', 'last_sport_time', 'last_lose-Comment', 'last_recipe-Comment', 'last_lose_weight', 'last_sport-Comment', 'sport_type-Comment']\n",
|
||||
"filename = 'data/宁夏能化干预人员问卷(20251207).xlsx'\n",
|
||||
"filename = 'data/宁夏能化干预人员问卷(20251215).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(all_title)\n",
|
||||
@@ -1203,10 +1388,43 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 2,
|
||||
"id": "91c53866-3725-4ceb-b0eb-23fb14e20561",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-14T23:43:35.251673Z",
|
||||
"iopub.status.busy": "2025-12-14T23:43:35.251057Z",
|
||||
"iopub.status.idle": "2025-12-14T23:43:35.339896Z",
|
||||
"shell.execute_reply": "2025-12-14T23:43:35.339186Z",
|
||||
"shell.execute_reply.started": "2025-12-14T23:43:35.251623Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"('梁正武', '男', '电气仪表中心', '1984-05-01', '02018801', 1)\n",
|
||||
"('张艳萍', '女', '公用工程运行部', '1978-09-01', '02020548', 1)\n",
|
||||
"('叶云飞', '男', '公用工程运行部', '1985-11-01', '02019460', 1)\n",
|
||||
"('李效龙', '男', 'BDO运行部', '1987-09-01', '0201968', 1)\n",
|
||||
"('何富来', '男', '宁夏能化', '1983-03-01', '02019507', 1)\n",
|
||||
"('马荣', '女', '公用工程运行部', '1984-03-01', '02020205', 1)\n",
|
||||
"('刘永清', '男', '热电运行部', '1968-10-01', '02019958', 1)\n",
|
||||
"('马学锋', '男', '热电运行部', '1974-12-01', '02020025', 1)\n",
|
||||
"('段庆霖', '男', '热电运行部', '1990-02-01', '02020062', 1)\n",
|
||||
"('周卫星', '男', '热电运行部', '1970-05-01', '02019986', 1)\n",
|
||||
"('姚户昌', '男', '热电运行部', '1970-12-01', '02019968', 1)\n",
|
||||
"('姜德溪', '男', '热电运行部', '1970-01-01', '2019970', 1)\n",
|
||||
"('陈海宝', '男', '乙炔运行部', '1990-07-01', '02019346', 1)\n",
|
||||
"('丁红忠', '男', '热电运行部', '1990-09-01', '02020160', 1)\n",
|
||||
"('孙柏', '男', '环保建材运行部', '1982-03-01', '02020446', 1)\n",
|
||||
"('黄博', '男', '物资采购中心', '1995-12-01', '03391681', 1)\n",
|
||||
"('王正东', '男', '热电运行部', '1990-01-01', '03428864', 1)\n",
|
||||
"17\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -1219,7 +1437,7 @@
|
||||
" password=\"songyi\"\n",
|
||||
")\n",
|
||||
"cur = conn.cursor()\n",
|
||||
"wb = openpyxl.load_workbook('data/宁夏能化干预人员问卷(20251207).xlsx',data_only=True)\n",
|
||||
"wb = openpyxl.load_workbook('data/宁夏能化干预人员问卷(20251215).xlsx',data_only=True)\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"org_id = 1\n",
|
||||
@@ -1245,8 +1463,15 @@
|
||||
" else:\n",
|
||||
" dict1['sex'] = '女'\n",
|
||||
" birth = str(sheet.cell(n, 5).value).split()[0]\n",
|
||||
" if len(birth)==7:\n",
|
||||
" dict1['birth'] = birth+'-01'\n",
|
||||
" \n",
|
||||
" if len(birth)<10:\n",
|
||||
" nian = birth.split('-')[0]\n",
|
||||
" yue = birth.split('-')[1].rjust(2,'0')\n",
|
||||
" if len(birth.split('-')[0]) ==3:\n",
|
||||
" ri = birth.split('-')[2].rjust(2,'0')\n",
|
||||
" else:\n",
|
||||
" ri = '01' \n",
|
||||
" dict1['birth'] = nian+'-'+ yue + '-'+ ri\n",
|
||||
" else:\n",
|
||||
" dict1['birth'] = birth\n",
|
||||
" dict1['unit'] = sheet.cell(n, 7).value\n",
|
||||
@@ -1346,15 +1571,31 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 3,
|
||||
"id": "b7133988-213c-4b52-8d6b-17b56b8ea310",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-14T23:43:56.303850Z",
|
||||
"iopub.status.busy": "2025-12-14T23:43:56.303555Z",
|
||||
"iopub.status.idle": "2025-12-14T23:43:56.413335Z",
|
||||
"shell.execute_reply": "2025-12-14T23:43:56.412897Z",
|
||||
"shell.execute_reply.started": "2025-12-14T23:43:56.303825Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"108 ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/宁夏能化干预人员问卷(20251207).xlsx',data_only=True)\n",
|
||||
"wb = openpyxl.load_workbook('data/宁夏能化干预人员问卷(20251215).xlsx',data_only=True)\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
@@ -1365,15 +1606,19 @@
|
||||
" dict1['name'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 4).value\n",
|
||||
" birth = str(sheet.cell(n, 5).value).split()[0]\n",
|
||||
" if len(birth)==7:\n",
|
||||
" dict1['birth'] = birth+'-01'\n",
|
||||
" else:\n",
|
||||
" dict1['birth'] = birth\n",
|
||||
" if len(birth)<10:\n",
|
||||
" nian = birth.split('-')[0]\n",
|
||||
" yue = birth.split('-')[1].rjust(2,'0')\n",
|
||||
" if len(birth.split('-')[0]) ==3:\n",
|
||||
" ri = birth.split('-')[2].rjust(2,'0')\n",
|
||||
" else:\n",
|
||||
" ri = '01' \n",
|
||||
" dict1['birth'] = nian+'-'+ yue + '-'+ ri\n",
|
||||
" dict1['unit'] = sheet.cell(n, 7).value\n",
|
||||
" person[code] = dict1\n",
|
||||
"#print(person)\n",
|
||||
"\n",
|
||||
"filename = 'data/surveys_records_2025-12-07.json'\n",
|
||||
"filename = 'data/surveys_records_2025-12-10.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
@@ -1431,7 +1676,7 @@
|
||||
" dict2['last_lose-Comment'] = data['last_lose-Comment']\n",
|
||||
" if code in person.keys():\n",
|
||||
" person[code][rq] = dict2\n",
|
||||
"filename = 'data/宁夏能化干预人员问卷情况(20251207).json'\n",
|
||||
"filename = 'data/宁夏能化干预人员问卷情况(20251215).json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
@@ -1449,9 +1694,17 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 4,
|
||||
"id": "55b20059-ae36-493e-b0c5-c7e35473efc7",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-14T23:44:12.601625Z",
|
||||
"iopub.status.busy": "2025-12-14T23:44:12.600884Z",
|
||||
"iopub.status.idle": "2025-12-14T23:44:12.741676Z",
|
||||
"shell.execute_reply": "2025-12-14T23:44:12.741060Z",
|
||||
"shell.execute_reply.started": "2025-12-14T23:44:12.601562Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -1468,7 +1721,7 @@
|
||||
"cur = conn.cursor()\n",
|
||||
"event_id = 1\n",
|
||||
"org_id = 1\n",
|
||||
"filename = 'data/宁夏能化干预人员问卷情况(20251207).json'\n",
|
||||
"filename = 'data/宁夏能化干预人员问卷情况(20251215).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = ['name','sex','birth','unit']\n",
|
||||
|
||||
Reference in new issue
Block a user