This commit is contained in:
512song committed 2023-05-06 21:32:55 +08:00
1 parent 89ae72f87e
commit 3c8e9c5157
8 files changed
+728 -191

No files matched your search

+196 -3
View File
@@ -96,7 +96,7 @@
"id": "a430da5f-1e5c-447f-96a1-344d03e57b31",
"metadata": {},
"source": [
"### 统计心理测评人员"
"### 统计未参加心理测评人员"
]
},
{
@@ -139,6 +139,82 @@
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "18b228d6-de4c-4274-b91e-53ca916d15cc",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-04T13:23:00.486920Z",
"iopub.status.busy": "2023-05-04T13:23:00.486074Z",
"iopub.status.idle": "2023-05-04T13:23:00.491430Z",
"shell.execute_reply": "2023-05-04T13:23:00.490205Z",
"shell.execute_reply.started": "2023-05-04T13:23:00.486878Z"
},
"tags": []
},
"source": [
"### 生成心理测评人员明细"
]
},
{
"cell_type": "code",
"execution_count": 56,
"id": "2909ec13-dd9e-4101-baee-d305a5804d36",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-04T14:05:07.858342Z",
"iopub.status.busy": "2023-05-04T14:05:07.857920Z",
"iopub.status.idle": "2023-05-04T14:05:08.265951Z",
"shell.execute_reply": "2023-05-04T14:05:08.265237Z",
"shell.execute_reply.started": "2023-05-04T14:05:07.858314Z"
},
"tags": []
},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"import csv\n",
"filename = 'data/高新区.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"cjry = set()\n",
"filename = 'data/Survey_20230424-psy.csv'\n",
"list2 = []\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" phone = str(line[2])\n",
" result = json.loads(line[5])\n",
" \n",
" for k, v in dict1.items():\n",
" if 'phone' in v.keys() and v['phone'] == phone:\n",
" list1 = []\n",
" list1.append(k)\n",
" list1.append(phone)\n",
" list1.append(v['name'])\n",
" list1.append(v['sex'])\n",
" if 'unit' in v.keys():\n",
" unit = v['unit']\n",
" else:\n",
" unit = ' '\n",
" list1.append(unit)\n",
" #print(k,v['phone'],type(result))\n",
" for k1, v1 in result.items():\n",
" list1.append(v1)\n",
" list2.append(list1)\n",
"filename = 'data/高新心理评估明细表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"#sheet.append(title)\n",
"for row in list2:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "519d9b3a-d0d8-44aa-a17d-65e7f21f088b",
@@ -187,6 +263,73 @@
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "d1edbc30-71a4-438d-ba35-a450f1519b7d",
"metadata": {},
"source": [
"### 生成中医测评人员明细"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "57adb577-f1fb-48ee-aed9-985bb44030b5",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-04T14:26:36.375248Z",
"iopub.status.busy": "2023-05-04T14:26:36.374749Z",
"iopub.status.idle": "2023-05-04T14:26:36.793076Z",
"shell.execute_reply": "2023-05-04T14:26:36.792383Z",
"shell.execute_reply.started": "2023-05-04T14:26:36.375200Z"
},
"tags": []
},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"import csv\n",
"filename = 'data/高新区.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"cjry = set()\n",
"filename = 'data/Survey_20230424-tcm1.csv'\n",
"list2 = []\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" phone = str(line[2])\n",
" result = json.loads(line[5])\n",
" \n",
" for k, v in dict1.items():\n",
" if 'phone' in v.keys() and v['phone'] == phone:\n",
" list1 = []\n",
" list1.append(k)\n",
" list1.append(phone)\n",
" list1.append(v['name'])\n",
" list1.append(v['sex'])\n",
" if 'unit' in v.keys():\n",
" unit = v['unit']\n",
" else:\n",
" unit = ' '\n",
" list1.append(unit)\n",
" #print(k,v['phone'],type(result))\n",
" for k1, v1 in result.items():\n",
" list1.append(v1)\n",
" list2.append(list1)\n",
"filename = 'data/高新中医明细表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"#sheet.append(title)\n",
"for row in list2:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "0b717a78-52db-4894-83c6-731a4935a02d",
@@ -427,13 +570,63 @@
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "5b14e6f4-2587-4819-ab97-8ec70a39a2ac",
"metadata": {},
"source": [
"### 心理测评计分分析"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f5910a5a-05a5-404f-b3e9-eca86226e244",
"id": "0274163c-ae65-41a4-bb27-ba9077a365db",
"metadata": {},
"outputs": [],
"source": []
"source": [
"import openpyxl\n",
"import json\n",
"import csv\n",
"filename = 'data/高新区.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"cjry = set()\n",
"filename = 'data/Survey_20230424-psy.csv'\n",
"list2 = []\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" phone = str(line[2])\n",
" result = json.loads(line[5])\n",
" \n",
" for k, v in dict1.items():\n",
" if 'phone' in v.keys() and v['phone'] == phone:\n",
" list1 = []\n",
" list1.append(k)\n",
" list1.append(phone)\n",
" list1.append(v['name'])\n",
" list1.append(v['sex'])\n",
" if 'unit' in v.keys():\n",
" unit = v['unit']\n",
" else:\n",
" unit = ' '\n",
" list1.append(unit)\n",
" #print(k,v['phone'],type(result))\n",
" for k1, v1 in result.items():\n",
" list1.append(v1)\n",
" list2.append(list1)\n",
"filename = 'data/高新心理评估明细表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"#sheet.append(title)\n",
"for row in list2:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
}
],
"metadata": {