20251223
This commit is contained in:
1 parent
b894e793a5
commit
72a94b8de3
3 files changed
+188
-40
No files matched your search
+150
-4
@@ -2056,9 +2056,7 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a51dadfb-30e7-40f3-a437-321aa986a10f",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# 北海体检情况汇总"
|
||||
]
|
||||
@@ -2162,6 +2160,152 @@
|
||||
"wb.save(filename) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ff38ecf9-0ef5-473e-a253-a29196c00307",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计北海APP用户信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"id": "5049ac44-3bf8-4759-8e1a-3345cc0bedf6",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-23T11:34:46.322569Z",
|
||||
"iopub.status.busy": "2025-12-23T11:34:46.322137Z",
|
||||
"iopub.status.idle": "2025-12-23T11:34:46.342939Z",
|
||||
"shell.execute_reply": "2025-12-23T11:34:46.342438Z",
|
||||
"shell.execute_reply.started": "2025-12-23T11:34:46.322545Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"张伟 18419216343\n",
|
||||
"李辉 18278953177\n",
|
||||
"刘涛 18066959139\n",
|
||||
"陈伟 13977908579\n",
|
||||
"沈鹏 13877945246\n",
|
||||
"王勇 13006999505\n",
|
||||
"李华 13949350582\n",
|
||||
"赵敏 13977996075\n",
|
||||
"张健 15278902286\n",
|
||||
"王勇 13397798753\n",
|
||||
"兰俊 13000000400\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"title = []\n",
|
||||
"\n",
|
||||
"filename = 'data/tb_user.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"dict2 = {}\n",
|
||||
"for item in dict1:\n",
|
||||
" id = item['id']\n",
|
||||
" dict2.setdefault(id,{})\n",
|
||||
" dict2[id] ['name']= item['username']\n",
|
||||
" dict2[id] ['phone']= str(item['mobile'])\n",
|
||||
" dict2[id] ['unit']= item['dept']\n",
|
||||
" dict2[id] ['birth']= item['birthday']\n",
|
||||
"for k,v in dict2.items():\n",
|
||||
" if v['name'] in list1:\n",
|
||||
" print(v['name'],v['phone'])\n",
|
||||
" else:\n",
|
||||
" list1.append(v['name'])\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"id": "865ece6f-2d6f-4ae8-a59d-81e2a4bfbbc3",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-23T11:34:51.869483Z",
|
||||
"iopub.status.busy": "2025-12-23T11:34:51.868754Z",
|
||||
"iopub.status.idle": "2025-12-23T11:34:52.535335Z",
|
||||
"shell.execute_reply": "2025-12-23T11:34:52.534820Z",
|
||||
"shell.execute_reply.started": "2025-12-23T11:34:51.869418Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"995\n",
|
||||
"张伟 18419216343\n",
|
||||
"李辉 18278953177\n",
|
||||
"刘涛 18066959139\n",
|
||||
"陈伟 13977908579\n",
|
||||
"沈鹏 13877945246\n",
|
||||
"王勇 13006999505\n",
|
||||
"李华 13949350582\n",
|
||||
"赵敏 13977996075\n",
|
||||
"张健 15278902286\n",
|
||||
"王勇 13397798753\n",
|
||||
"兰俊 13000000400\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"title = []\n",
|
||||
"\n",
|
||||
"filename = 'data/tb_user.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"dict2 = {}\n",
|
||||
"for item in dict1:\n",
|
||||
" id = item['id']\n",
|
||||
" dict2.setdefault(id,{})\n",
|
||||
" dict2[id] ['name']= item['username']\n",
|
||||
" dict2[id] ['phone']= item['mobile']\n",
|
||||
" dict2[id] ['unit']= item['dept']\n",
|
||||
" dict2[id] ['birth']= item['birthday']\n",
|
||||
"print(len(dict2))\n",
|
||||
"for k,v in dict2.items():\n",
|
||||
" if v['name'] in list1:\n",
|
||||
" print(v['name'],v['phone'])\n",
|
||||
" else:\n",
|
||||
" list1.append(v['name'])\n",
|
||||
"wb = openpyxl.load_workbook('data/北海炼化职业体检数据-11.23.xlsx')\n",
|
||||
"#sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"sheet = wb['2024']\n",
|
||||
"\n",
|
||||
"list2 = []\n",
|
||||
"for n in range(2, sheet.max_row+1):\n",
|
||||
" name = sheet.cell(n, 2).value\n",
|
||||
" phone = str(sheet.cell(n, 6).value)\n",
|
||||
" for k,v in dict2.items():\n",
|
||||
" if v['name'] ==name and v['phone']== phone:\n",
|
||||
" list2.append(str(sheet.cell(n, 1).value))\n",
|
||||
"for n in range(2, sheet.max_row+1):\n",
|
||||
" code = str(sheet.cell(n, 1).value)\n",
|
||||
" name = sheet.cell(n, 2).value\n",
|
||||
" phone = str(sheet.cell(n, 6).value)\n",
|
||||
" if code not in list2:\n",
|
||||
" for k,v in dict2.items():\n",
|
||||
" if v['name'] ==name and v['phone']!= phone:\n",
|
||||
" print(code,v['name'],phone,v['phone'],v['birth'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "76c5c17a-462d-4a7b-95a5-6b895f5a25dc",
|
||||
@@ -3027,7 +3171,9 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "75ee44f4-2874-44eb-b071-7666f52a60f1",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"source": [
|
||||
"# 2025年体质检测"
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user