20221102
This commit is contained in:
1 parent
8542f74bd0
commit
5eb7a1513d
2 files changed
+417
-76
No files matched your search
+95
-76
@@ -10,27 +10,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": null,
|
||||
"id": "f6bc68b5-9ed8-4b28-ab1a-452107b6429a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-26T11:58:59.214911Z",
|
||||
"iopub.status.busy": "2022-10-26T11:58:59.214385Z",
|
||||
"iopub.status.idle": "2022-10-26T11:59:00.200796Z",
|
||||
"shell.execute_reply": "2022-10-26T11:59:00.199708Z",
|
||||
"shell.execute_reply.started": "2022-10-26T11:58:59.214863Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
@@ -72,15 +57,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 29,
|
||||
"execution_count": 17,
|
||||
"id": "97031317-76ed-4404-b922-6ca749e4fd2a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-26T15:13:05.551848Z",
|
||||
"iopub.status.busy": "2022-10-26T15:13:05.551291Z",
|
||||
"iopub.status.idle": "2022-10-26T15:13:05.733924Z",
|
||||
"shell.execute_reply": "2022-10-26T15:13:05.732766Z",
|
||||
"shell.execute_reply.started": "2022-10-26T15:13:05.551800Z"
|
||||
"iopub.execute_input": "2022-11-01T09:18:38.933088Z",
|
||||
"iopub.status.busy": "2022-11-01T09:18:38.932552Z",
|
||||
"iopub.status.idle": "2022-11-01T09:18:39.012745Z",
|
||||
"shell.execute_reply": "2022-11-01T09:18:39.011599Z",
|
||||
"shell.execute_reply.started": "2022-11-01T09:18:38.933039Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -147,15 +132,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 30,
|
||||
"execution_count": 18,
|
||||
"id": "f70a02f2-934e-43ed-93ff-b34cb732dfc6",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-26T15:13:15.553588Z",
|
||||
"iopub.status.busy": "2022-10-26T15:13:15.553050Z",
|
||||
"iopub.status.idle": "2022-10-26T15:13:15.663507Z",
|
||||
"shell.execute_reply": "2022-10-26T15:13:15.662380Z",
|
||||
"shell.execute_reply.started": "2022-10-26T15:13:15.553540Z"
|
||||
"iopub.execute_input": "2022-11-01T09:18:42.502192Z",
|
||||
"iopub.status.busy": "2022-11-01T09:18:42.501603Z",
|
||||
"iopub.status.idle": "2022-11-01T09:18:42.729776Z",
|
||||
"shell.execute_reply": "2022-11-01T09:18:42.728671Z",
|
||||
"shell.execute_reply.started": "2022-11-01T09:18:42.502143Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -190,7 +175,7 @@
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/北海炼化体测情况表(截至20221026).xlsx'\n",
|
||||
"filename = 'data/北海炼化体测情况表(截至20221101).xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -200,6 +185,76 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "84325f89-1408-4d0a-b877-f4b54bcb22ce",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 统计部门测试人员情况"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"id": "c42c5c04-49f3-4b4c-8f77-e37cfa9748f2",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-11-01T09:27:40.105525Z",
|
||||
"iopub.status.busy": "2022-11-01T09:27:40.104998Z",
|
||||
"iopub.status.idle": "2022-11-01T09:27:40.151243Z",
|
||||
"shell.execute_reply": "2022-11-01T09:27:40.150059Z",
|
||||
"shell.execute_reply.started": "2022-11-01T09:27:40.105476Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"title = ['部门','部门人数','已测人数','未测人数']\n",
|
||||
"filename = 'data/北海炼化人员_2022.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"filename = 'data/result_北海炼化2022.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
"\n",
|
||||
"dict3 = {}\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" dict3.setdefault(v['unit'],{})\n",
|
||||
" dict3[v['unit']].setdefault('人数',0)\n",
|
||||
" dict3[v['unit']].setdefault('已测人数',0)\n",
|
||||
" dict3[v['unit']]['人数'] = dict3[v['unit']]['人数']+1\n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" if len(v.keys())>5: \n",
|
||||
" dict3[v['unit']]['已测人数'] = dict3[v['unit']]['已测人数'] + 1\n",
|
||||
"list1 = []\n",
|
||||
"\n",
|
||||
"for k, v in dict3.items():\n",
|
||||
" list2 = []\n",
|
||||
" list2 = [k,v['人数'],v['已测人数'],v['人数']-v['已测人数']]\n",
|
||||
" \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",
|
||||
" \n",
|
||||
"wb.save(filename)\n",
|
||||
"print('ok!')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5ec595eb-f979-425e-b7eb-9af094ffb43d",
|
||||
@@ -210,15 +265,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": 8,
|
||||
"id": "a9460ee7-1f60-4a3b-a45d-8a1dba04b920",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-26T11:59:11.407159Z",
|
||||
"iopub.status.busy": "2022-10-26T11:59:11.406624Z",
|
||||
"iopub.status.idle": "2022-10-26T11:59:11.664219Z",
|
||||
"shell.execute_reply": "2022-10-26T11:59:11.663061Z",
|
||||
"shell.execute_reply.started": "2022-10-26T11:59:11.407111Z"
|
||||
"iopub.execute_input": "2022-10-31T11:54:40.324705Z",
|
||||
"iopub.status.busy": "2022-10-31T11:54:40.324184Z",
|
||||
"iopub.status.idle": "2022-10-31T11:54:40.626097Z",
|
||||
"shell.execute_reply": "2022-10-31T11:54:40.624830Z",
|
||||
"shell.execute_reply.started": "2022-10-31T11:54:40.324656Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -255,7 +310,7 @@
|
||||
" \n",
|
||||
"filename = 'data/北海炼化人员_2022.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl) \n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) \n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
@@ -269,41 +324,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": null,
|
||||
"id": "61fbd157-f4f0-4c85-98dc-0e79ee99280b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-26T11:59:14.395184Z",
|
||||
"iopub.status.busy": "2022-10-26T11:59:14.394650Z",
|
||||
"iopub.status.idle": "2022-10-26T11:59:14.567363Z",
|
||||
"shell.execute_reply": "2022-10-26T11:59:14.566447Z",
|
||||
"shell.execute_reply.started": "2022-10-26T11:59:14.395136Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"00068 张利雄 1987-09-24\n",
|
||||
"00120 黎秀珍 1966-12-22\n",
|
||||
"00259 彭秋丽 1989-08-15\n",
|
||||
"00348 黄宏州 1995-02-19\n",
|
||||
"00424 易华锋 1985-12-02\n",
|
||||
"00524 周爱娟 1971-10-11\n",
|
||||
"00525 马遥碧 1971-06-13\n",
|
||||
"00534 潘永远 1962-03-24\n",
|
||||
"00614 刘文涛 1997-07-13\n",
|
||||
"00689 陈雪 1966-11-14\n",
|
||||
"00725 冯剑秋 1972-01-07\n",
|
||||
"00727 汪纯燕 1971-12-06\n",
|
||||
"00733 曾媛 1972-07-14\n",
|
||||
"00758 谭志坚 1972-04-02\n",
|
||||
"00798 冯鸥 1992-11-24\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -344,16 +370,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"execution_count": null,
|
||||
"id": "d3ca4d45-6a83-4d50-8419-cf8aa9b3aa4c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2022-10-26T12:11:23.788353Z",
|
||||
"iopub.status.busy": "2022-10-26T12:11:23.787816Z",
|
||||
"iopub.status.idle": "2022-10-26T12:11:23.836530Z",
|
||||
"shell.execute_reply": "2022-10-26T12:11:23.835397Z",
|
||||
"shell.execute_reply.started": "2022-10-26T12:11:23.788303Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
|
||||
Reference in new issue
Block a user