20251110
This commit is contained in:
1 parent
03de3b1663
commit
f3a7c981d5
4 files changed
+408
-184
No files matched your search
@@ -2225,6 +2225,59 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e4c15761-e461-447a-bc60-5e5c29ba8cb3",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计未提供手机号码人员明细表"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 66,
|
||||
"id": "80c2b300-6a4f-4223-9b7a-9b8978ad4609",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-11-10T09:49:26.870477Z",
|
||||
"iopub.status.busy": "2025-11-10T09:49:26.869856Z",
|
||||
"iopub.status.idle": "2025-11-10T09:49:26.920161Z",
|
||||
"shell.execute_reply": "2025-11-10T09:49:26.919605Z",
|
||||
"shell.execute_reply.started": "2025-11-10T09:49:26.870441Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"filename = 'data/result_镇海2025.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"filename = 'data/镇海人员2025.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"\n",
|
||||
"i = 1\n",
|
||||
"for k, v in dict2.items(): \n",
|
||||
" if 'phone' not in v.keys() and k in dict1.keys():\n",
|
||||
" list2 = [i,k,v['name'],v['unit']]\n",
|
||||
" i+=1\n",
|
||||
" list1.append(list2)\n",
|
||||
"#print(list1)\n",
|
||||
"filename = f'data/镇海未提供手机号码人员名单.xlsx'\n",
|
||||
"title = ['序号','员工编号','姓名','部门']\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
"for row in list1:\n",
|
||||
" sheet.append(row) \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3e0e3b48-12f1-42f0-ba3c-f949857d29f7",
|
||||
|
||||
Reference in new issue
Block a user