This commit is contained in:
512song committed 2023-11-28 15:51:26 +08:00
1 parent 2d6db59b1c
commit 2f664617d0
2 files changed
+122 -37

No files matched your search

+81 -6
View File
@@ -1209,7 +1209,7 @@
" if 'phone' in v.keys():\n",
" phone[v['phone']] = k\n",
"list1 = []\n",
"filename = 'data/Survey_20231119.csv'\n",
"filename = 'data/Survey_20231127.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -1217,19 +1217,30 @@
" list1.append(line)\n",
"#print(list1)\n",
"dict2 = {}\n",
"psy = []\n",
"psy =[]\n",
"tcm = []\n",
"spine = []\n",
"\n",
"for i in range(0,44):\n",
"for i in range(0,45):\n",
" psy.append(0)\n",
"psy[44] = []\n",
"for i in range(0,60):\n",
" tcm.append(0)\n",
"for i in range(0,26):\n",
" spine.append(0)\n",
"\n",
"for item in list1:\n",
" if item[2] in phone.keys(): \n",
" if item[2] in phone.keys():\n",
" psy =[]\n",
" tcm = []\n",
" spine = []\n",
" for i in range(0,45):\n",
" psy.append(0)\n",
" psy[44] = []\n",
" for i in range(0,60):\n",
" tcm.append(0)\n",
" for i in range(0,26):\n",
" spine.append(0)\n",
" \n",
" content = json.loads(item[5])\n",
" if phone[item[2]] not in dict1.keys():\n",
" dict1[phone[item[2]]] = dict3[phone[item[2]]]\n",
@@ -1246,6 +1257,13 @@
" i = int(k[5:])\n",
" spine[i-1] = int(v)\n",
" if 'psy' in item[5]:\n",
" for i in range(5,26):\n",
" new_valve = 5-psy[i]\n",
" psy[i] = new_valve\n",
" for i in range(26,40):\n",
" new_valve = 1+psy[i]\n",
" psy[i] = new_valve\n",
" \n",
" dict1[phone[item[2]]]['psy'] = psy\n",
" if 'tcm' in item[5]:\n",
" dict1[phone[item[2]]]['tcm'] = tcm\n",
@@ -1836,10 +1854,67 @@
" "
]
},
{
"cell_type": "markdown",
"id": "33b0075e-5b48-44ed-9cc7-f316ad9a0237",
"metadata": {},
"source": [
"## 核对报告缺失情况"
]
},
{
"cell_type": "code",
"execution_count": 132,
"id": "2e5ae18e-c153-4cdf-825e-f969080eea16",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-28T03:01:47.337951Z",
"iopub.status.busy": "2023-11-28T03:01:47.337489Z",
"iopub.status.idle": "2023-11-28T03:01:47.391606Z",
"shell.execute_reply": "2023-11-28T03:01:47.390188Z",
"shell.execute_reply.started": "2023-11-28T03:01:47.337914Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"719\n",
"506 陆进生\n",
"617 张升坚\n",
"566 高越\n"
]
}
],
"source": [
"import json\n",
"import csv\n",
"import glob\n",
"from pathlib import Path\n",
"\n",
"\n",
"filename = 'data/result_北海炼化2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"fi_path = '/home/songyi/pdf-typescript/北海炼化2023_1'\n",
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
"list1 = []\n",
"for fl in fls:\n",
" fn = Path(fl).stem.split('-')[0]\n",
" list1.append(int(fn))\n",
"print(len(dict1))\n",
"for k ,v in dict1.items():\n",
" if int(k) not in list1:\n",
" print(k,v['name'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "01444d7a-0a47-4cc4-881b-783100553cc1",
"id": "a362768f-a67f-4c64-a830-b6a745ab35e4",
"metadata": {},
"outputs": [],
"source": []