This commit is contained in:
512song committed 2024-06-16 23:45:41 +08:00
1 parent f44b30e86f
commit 44bd4fe5fa
5 files changed
+4807 -300

No files matched your search

+90 -1
View File
@@ -332,10 +332,99 @@
"wb.save(filename) "
]
},
{
"cell_type": "markdown",
"id": "821ab165-59db-4103-8366-b82f99c16b09",
"metadata": {},
"source": [
"## 统计人员成绩"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "b5ab3311-34fa-4a16-96d2-40884d01813b",
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-14T09:16:23.542013Z",
"iopub.status.busy": "2024-06-14T09:16:23.541762Z",
"iopub.status.idle": "2024-06-14T09:16:23.607316Z",
"shell.execute_reply": "2024-06-14T09:16:23.606758Z",
"shell.execute_reply.started": "2024-06-14T09:16:23.541992Z"
}
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/data_中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"list1 = []\n",
"for k, v in dict1.items():\n",
" \n",
" list2 = [v['name'],v['unit'],v['sex'],v['age'],v['score']]\n",
" list1.append(list2)\n",
"filename = 'data/中安联合体测人员成绩表.xlsx'\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": "95846aa0-fae7-49b6-8bdc-a952611a4962",
"metadata": {},
"source": [
"## 统计无电话人员信息"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "582f8da3-1ba9-4d50-837b-1e86dce6fd69",
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-14T14:27:27.272175Z",
"iopub.status.busy": "2024-06-14T14:27:27.271437Z",
"iopub.status.idle": "2024-06-14T14:27:27.298093Z",
"shell.execute_reply": "2024-06-14T14:27:27.297622Z",
"shell.execute_reply.started": "2024-06-14T14:27:27.272089Z"
}
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/data_中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"list1 = []\n",
"for k, v in dict1.items():\n",
" if 'phone' not in dict2[k].keys():\n",
" list2 = [k,v['name'],v['unit']]\n",
" list1.append(list2)\n",
"filename = 'data/中安联合缺少手机号码体测人员.xlsx'\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": "code",
"execution_count": null,
"id": "53e0e519-4b61-42c7-9a75-dad453c0ff64",
"id": "5b31ba17-4839-4bf6-98c5-b5a5a4ac2a7a",
"metadata": {},
"outputs": [],
"source": []